-
Notifications
You must be signed in to change notification settings - Fork 28.7k
SliverAppBar.large and SliverAppBar.medium do not use foreground color #110951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related AppBarTheme issue #110878The DartPad version using Flutter stable 3.3.0 now also show how issue #107305 has regressed to Flutter 3.3.0 stable, as mentioned here: #110878 When running the sample code for this demo on master channel we can see fix #108332 in action on the icons, but on stable with DartPad we can see the mentioned icon color issue. However, on master we can also notice that the fix #108322 is not of the fidelity level normally observed concerning theme animation lerping. The Icon brightness flickers via their default colors, when toggling between light/dark or M2/M3. This is particularly clear when looking at the example that sets AppBar properties to same values in both light and dark mode via widget properties, but it can also be seen when set via theme, it flickers via black. This kind of theme transition "color jank" via default color, is normally not observed when changing themes or mode. |
Reproducible using the code sample provided. flutter doctor -v
|
Thanks @danagbemava-nc for the speedy triage. Sadly I did not catch this one in time so it could be fixed before Flutter 3.3.0 stable release. The medium and large SliverAppBars had been around for quite some time in master, I had just not tried them until just before the 3.3 release, as seen here #103962 (comment). As long as devs stick to an AppBar background where the default foreground color is usable this not an issue, but not all apps do. |
In our app, even the normal AppBar doesn't use foregroundColor for the automatically implied leading and the actions anymore. This is a pretty annoying problem, because we have many dark screens, where we now can't use |
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 |
Uh oh!
There was an error while loading. Please reload this page.
Steps to Reproduce
When defining
foregroundColor
for aSliverAppBar.large
orSliverAppBar.medium
either via anAppBarTheme
or their properties, the defined color is not used by the app bar.Using AppBarTheme to set colors
Expected
SliverAppBar.medium
andSliverAppBar.large
title and icon colors to look like they do onAppBar
andSliverAppBar
. The background color does, but the definedAppBarTheme.foregroundColor
is not used by the title.Using SliverAppBar properties to set colors
Expected
SliverAppBar.medium
andSliverAppBar.large
title and icon colors to look like they do onAppBar
andSliverAppBar
. The background color does, but the definedforegroundColor
forSliverAppBar.medium
andSliverAppBar.large
is not used by the title.Cause of Issue
This issue was mentioned in PR comment that implemented the
SliverAppBar.medium
andSliverAppBar.large
here: #103962 (comment)It was discovered that that text style for
_MediumScrollUnderFlexibleConfig
and_LargeScrollUnderFlexibleConfig
do not respect and fall through via widget properties orAppBarTheme.of(context)
. They now do this:It would be expected that they would fall through via widget
foregroundColor
andAppBarTheme.of(context).foregroundColor
before resorting to default value, in order to respect and use widget and themedAppBar
foreground color, just like the vanillaAppBar
andSliverAppBar
does.Additionally, correct default styles for M2 would be a nice addition in order to keep the new
SliverAppBar
inline with previous behavior, also when using Material 2.Issue Demo App
For convenience the issue demo app is available in DartPad here: https://dartpad.dev/?id=78c1fa0d845892e1cf8ea8b58adbe576
The live DartPad example uses Flutter stable 3.3.0, but the issue and results were also verified and are the same Flutter master 3.4.0-19.0.pre.70.
Issue reproduction sample code
The issue reproduction code is also available in this GIST
Flutter doctor
The text was updated successfully, but these errors were encountered: