-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Deprecate ThemeData.errorColor
and ThemeData.backgroundColor
#94156
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
Conversation
I am wondering if this is a bug with dart fix itself, cc @bwilkerson |
It's certainly possible that there's a bug, but I think there's a different reason for what you're seeing. When the transforms (the things with titles) in the When the transform for I recently (11/23) updated
I'm guessing that this change hasn't yet rolled from the Dart SDK into Flutter. When it does I believe that it ought to fix this problem. We could confirm that hypothesis by taking the output from the first run of |
Thank you very much @bwilkerson! That makes a lot of sense. |
Thanks @bwilkerson and @Piinks! I tried it out and it did indeed apply both fixes. However (expectedly), it creates an additional
@markusaksli-nc yes, I'll let #95870 land first and then get this one in. |
name: 'colorScheme' | ||
style: optional_named | ||
argumentValue: | ||
expression: '{% colorScheme %}.copyWith(background: {% backgroundColor %})' |
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.
I think this is why an additional copyWith is being added.
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.
I was able to simplify the output a little bit, but couldn't find a way to avoid the additional copyWith
in the case where both colors are present. I think it's still a fine change.
No cycles to finish this at the moment, will get to it eventually. |
Can't get the new commits to appear, will close and reopen a new pull request: #110162 |
In line with https://flutter.dev/go/material-theme-system-updates and #91772, deprecates redundant
ThemeData
properties.ThemeData.errorColor
ColorScheme.error
TextField
error statesThemeData.backgroundColor
ColorScheme.background
A Dart fix is provided.
This is not a breaking change, per our policy.