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
Reorder materialStateProperty
defaults
#125905
Reorder materialStateProperty
defaults
#125905
Conversation
|
||
@override | ||
EdgeInsetsGeometry? get collapsedCenteredTitlePadding => const EdgeInsetsDirectional.only(start: 40); | ||
|
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.
Changes in app_bar_template.dart are coming from a previous PR which only removed the defaults in app_bar.dart but didn't update the template. To avoid this kind of mismatch in the future, I will add a test shard to CI to make sure the template and generated defaults can match each other.
c3fbb4f
to
3a68961
Compare
materialStateProperty
defaults
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
Fixes flutter#122250. This PR is to make sure all the MaterialStateProperty defaults are able to correctly resolve different states. * When a widget is pressed, it is also hovered, so we need to put the `MaterialState.pressed` check before `MaterialState.hovered`. * When a widget is focused, the widget should still be able to be hovered, so we should check `MaterialState.hovered` before `MaterialState.focused`. * There are also cases like in _InputDecoratorDefaultsM3, the `MaterialState.disabled` should be checked before `MaterialState.error`. the order should be disabled, (error), pressed, hovered, focused.
Fixes #122250. This PR is to make sure all the MaterialStateProperty defaults are able to correctly resolve different states.
MaterialState.pressed
check beforeMaterialState.hovered
.MaterialState.hovered
beforeMaterialState.focused
.MaterialState.disabled
should be checked beforeMaterialState.error
.the order should be disabled, (error), pressed, hovered, focused.
Pre-launch Checklist
///
).