You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for largeTitle and middle #53788
Once you scroll down on CupertinoSliverNavigationBar the middle widget automatically appears -- this widget cannot be customized while simultaneously having a customized largeTitle. If you try to use a custom middle widget it will appear even while the largeTitle is active in its regular state. There's really no option to customize the middle state of the largeTitle.
Can't customize:
Can customize:
Right now both have to change together. Ideally you could set a different font weight, or even a different widget when the large title is gone.
@shamilovtim I'm not sure I understood the bug. Could you describe a bit more what the desired behavior is? Having some flag to allow the middle widget on top and the largeTitle below to appear simultaneously? Do you have a native iOS example to model after?
@jackie099 let's keep bugs single purposed. Could you open a separate issue to describe the visual update you meant?
@xster thanks for responding. The middle position and the large position are not customizable separately and cannot have separate typography. If you use the middle property in order to customize the middle position, it doesn't have the desired effect because it will appear overtop of your largetitle. Overall, there is no way to customize the typography of the two separate elements at the same time. You can only customize largetitle, but you cannot customize both at the same time.
Thanks for the details. I'm still trying to parse the action item.
The middle position and the large position are not customizable separately
Can't you supply a middle and a largeTitle widget separately with whatever customization you need?
cannot have separate typography
They receive a default DefaultTextStyle above those widgets but whatever text styling your supply to the actual widgets themselves take priority.
it doesn't have the desired effect because it will appear overtop of your largetitle
I imagine this is the main ask? Add a shouldTheMiddleWidgetYouSuppliedFadeAwayWhenTheLargeTitleAppears type flag?
Overall, there is no way to customize the typography of the two separate elements at the same time.
I think that's true. Maybe so by design since the font are different. Perhaps you're asking for a way to force some subset of the styling (excluding font size, letter spacing etc) to be the same via a single inherited widget? Unless this is a big impediment, I'd consider this a low-prio ask since the fonts are indeed different by design.
Can't you supply a middle and a largeTitle widget separately with whatever customization you need?
No you cant if you use the 'middle' widget it unceremoniously appears while the largeTitle is active (which according to the docs isn't a bug, but I don't understand why that's not a bug).
I imagine this is the main ask? Add a shouldTheMiddleWidgetYouSuppliedFadeAwayWhenTheLargeTitleAppears type flag?
Yes that would be one way of solving this issue
I think that's true. Maybe so by design since the font are different. Perhaps you're asking for a way to force some subset of the styling (excluding font size, letter spacing etc) to be the same via a single inherited widget? Unless this is a big impediment, I'd consider this a low-prio ask since the fonts are indeed different by design.
No I'm specifically asking that there be an option for them to be considered separate widgets. Consider this: for whatever reason a dev wants them to be two different colors, typefaces, weighs, etc. in the middle state or the large state. It's not about stopping/enforcing inheritance, it's about allowing two separate styles.
Reacted by delbyze, Opservo, Gabriel Royer, Aurélien Lepage, Truls Matias Torgersen and Dmytro Polishenko
No you cant if you use the 'middle' widget it unceremoniously appears while the largeTitle is active (which according to the docs isn't a bug, but I don't understand why that's not a bug).
I'm surprised that this isn't a bug. From the docs:
For advanced uses, an optional middle widget can be supplied to show a different widget in the middle of the navigation bar when the sliver is collapsed.
This to me implies that the middle widget wouldn't show up when the sliver is not collapsed.
Reacted by Truls Matias Torgersen, Sergio Molchanovsky, Simon and Dmytro Polishenko
I have the similar issue.
If I supply just Text widget as a largeTitle, everything works okay: large title and small middle text on scroll.
But if I style it, both largeTitle and middle share the same style. And large middle text looks ugly.
upd.
I managed to do that, but that's not easy.
I wrapped by NavBar into CupertinoTheme and set custom sizes for titles.
changed the title [-]CupertinoSliverNavigationBar largeTitle cannot be customized in its middle state[/-][+]CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for `largeTitle` and `middle`[/+]on Aug 22, 2024
Hi @shamilovtim@SimonVillage is this still an issue? I'm able to customize the largeTitle and middle properties separately in CupertinoSliverNavigationBar with the flag alwaysShowMiddle set to false.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
jackie099 commentedon May 21, 2020
That will be nice to have. Also, CupertinoSliverNavigationBar needs a slight visual update to match what it looks on iOS13.
xster commentedon Oct 30, 2020
@shamilovtim I'm not sure I understood the bug. Could you describe a bit more what the desired behavior is? Having some flag to allow the middle widget on top and the largeTitle below to appear simultaneously? Do you have a native iOS example to model after?
@jackie099 let's keep bugs single purposed. Could you open a separate issue to describe the visual update you meant?
shamilovtim commentedon Oct 30, 2020
@xster thanks for responding. The middle position and the large position are not customizable separately and cannot have separate typography. If you use the middle property in order to customize the middle position, it doesn't have the desired effect because it will appear overtop of your largetitle. Overall, there is no way to customize the typography of the two separate elements at the same time. You can only customize largetitle, but you cannot customize both at the same time.
xster commentedon Oct 30, 2020
Thanks for the details. I'm still trying to parse the action item.
Can't you supply a
middleand alargeTitlewidget separately with whatever customization you need?They receive a default DefaultTextStyle above those widgets but whatever text styling your supply to the actual widgets themselves take priority.
I imagine this is the main ask? Add a
shouldTheMiddleWidgetYouSuppliedFadeAwayWhenTheLargeTitleAppearstype flag?I think that's true. Maybe so by design since the font are different. Perhaps you're asking for a way to force some subset of the styling (excluding font size, letter spacing etc) to be the same via a single inherited widget? Unless this is a big impediment, I'd consider this a low-prio ask since the fonts are indeed different by design.
shamilovtim commentedon Oct 30, 2020
No you cant if you use the 'middle' widget it unceremoniously appears while the largeTitle is active (which according to the docs isn't a bug, but I don't understand why that's not a bug).
Yes that would be one way of solving this issue
No I'm specifically asking that there be an option for them to be considered separate widgets. Consider this: for whatever reason a dev wants them to be two different colors, typefaces, weighs, etc. in the middle state or the large state. It's not about stopping/enforcing inheritance, it's about allowing two separate styles.
holland-hng commentedon Nov 10, 2020
i have same isssue :v
GabRoyer commentedon Mar 15, 2021
I'm surprised that this isn't a bug. From the docs:
This to me implies that the middle widget wouldn't show up when the sliver is not collapsed.
kstam commentedon Jun 19, 2021
The bug seems to be here btw. I wonder if this is a parameter that should be passed into the Cupertino header instead of the current logic. Changing this line to
falsemakes the header behave as per the description.https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/cupertino/nav_bar.dart#L716
subzero911 commentedon Jan 27, 2022
I have the similar issue.
If I supply just Text widget as a largeTitle, everything works okay: large title and small middle text on scroll.
But if I style it, both largeTitle and middle share the same style. And large middle text looks ugly.
upd.
I managed to do that, but that's not easy.
I wrapped by NavBar into CupertinoTheme and set custom sizes for titles.
SimonVillage commentedon Mar 12, 2022
Is someone willing to make a PR for this?
[-]CupertinoSliverNavigationBar largeTitle cannot be customized in its middle state[/-][+]CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for `largeTitle` and `middle`[/+]victorsanni commentedon Sep 27, 2024
Hi @shamilovtim @SimonVillage is this still an issue? I'm able to customize the
largeTitleandmiddleproperties separately in CupertinoSliverNavigationBar with the flagalwaysShowMiddleset to false.victorsanni commentedon Oct 12, 2024
Closing as duplicate of #113542.
github-actions commentedon Oct 26, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.