-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update parameters to the styleFrom button methods.
#105291
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
Update parameters to the styleFrom button methods.
#105291
Conversation
|
This will require #105290 to land first, as the deprecation versions are now using beta releases, not dev releases. |
guidezpl
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.
This is clean.
_ ___ _____ __ __
| | / __|_ _| \/ |
| |_| (_ | | | | |\/| |
|____\___| |_| |_| |_|
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
…l need to be migrated when flutter/flutter#105291 lands on stable.
…l need to be migrated when flutter/flutter#105291 lands on stable.
…l need to be migrated when flutter/flutter#105291 lands on stable.
…l need to be migrated when flutter/flutter#105291 lands on stable.
|
This PR appears to have broken the flutter-analyze bot on the Dart build system. Based on the log output: it appears that the flutter gallery app is still using This suggests that the flutter gallery app is not being analyzed as part of the build process, which might indicate a different kind of issue. |
|
You may want use pinning to allow fixes for changes such as this to get in without breaking builds. See also https://github.com/flutter/gallery#tests. |
|
@athomas for the previous comment. |
|
The point of the multi headed testing is to detect problems before the rolls, and pinning would defeat that. |
|
Looks like some of the API docs still refer to |
* Update parameters to the `styleFrom` button methods. * Updated the Flutter fix data to point to this PR. * Updated handling of background color to better maintain backwards compatibility with previous API.
…s from `ElevatedButton.styleFrom` (#5566) This PR is to remove deprecated `primary` and `onPrimary` references([deprecation PR](flutter/flutter#105291)) from `ElevatedButton.styleFrom`. `primary` should be replaced with `backgroundColor` and `onPrimary` should be replaced with `foregroundColor`. No new tests needed. Please let me know if I incorrectly handled the CHANGELOG and version change.
To make the common button
.styleFrommethods a little easier to use, this PR adds the following parameters to each ofElevatedButton.styleFrom,OutlinedButton.styleFromandTextButton.styleFrom:If given they will be used to construct foreground and background MaterialStateProperty colors for the style. These replace
primary,onPrimary, andonSurfacewhich are deprecated.To update your apps to use these new parameters you can either use the quick fix feature of your IDE, or use Flutter Fix to apply the given fixes to your entire project.
Pre-launch Checklist
///).