-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Removed ProgressIndicator accentColor dependency. #77976
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
Removed ProgressIndicator accentColor dependency. #77976
Conversation
Added new 'color' property to ProgressIndicator to make it easier to specify a constant color for the indicator.
HansMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@HansMuller I've just encountered with this breaking change in the latest beta version. Since it's breaking (the primary color is being used instead of the secondary color), what is the path to take migration wise? Are there any plans to create a |
|
We did discuss adding a theme for this, but it didn't seem like it would have affected that many apps. However, after hearing from you (and some internal users), I will put together a PR with a ProgressIndicatorTheme shortly. I will reference this bug so stay tuned. |
|
Just put up a PR that adds a ProgressIndicatorTheme: #81075. |
|
Just ran into this on stable, is there a reason you opted for using primary instead of secondary now? It would also be nice if this breaking change could be added to the breaking changelog and announced on the flutter announce channel since I expect lots of people running into this change |
This was to match the Material Design spec which uses the primary color:
It will be added as part of a larger accent color deprecation update along with a migration guide. Sorry if this caused an issue for you. We are trying to migrate a lot of these older top-level ThemeData params to using the color scheme instead, but we could have had better communication on this one. |
@darrenaustin May I know where can I get this migration guide? |
This PR removes the ProgressIndicator widget's accentColor dependency per #56918.
The previous implementation painted the color of the indicator with the value of the
valueColoranimated color. If that was null then it would default to the theme'sThemeData.accentColor. With this PR we are changing the default to the theme'scolorScheme.primary. In addition we have added a new 'color' property to the indicator that makes it easier to set a constant color.So to summarize, the color of the ProgressIndicator is now:
We have also changed the
backgroundColorto default to the theme'scolorScheme.backgroundinstead oftheme.backgroundColor. This is usually the same color, but will help with the transition to using the color scheme for everything.Breaking change
This is a breaking change. For apps that do need a specific color for a progress indicator, you can use the
colorparameter on the indicator directly:You can also of course set the value for the background color as well:
A new tests were added to verify the default values for the indicators' color are now
ColorScheme.primary.This PR was tested against internal Google apps in cl/360773269