Skip to content
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

Added MaterialStateProperty.all() convenience method #56589

Merged
merged 1 commit into from May 8, 2020

Conversation

HansMuller
Copy link
Contributor

@HansMuller HansMuller commented May 7, 2020

Added a little bit of extra shorthand to MaterialStateProperty for the case where the MaterialStateProperty just represents one value for all states.

Instead of writing this:

MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => Colors.blue)

You can write:

MaterialState.all<Color>(Colors.blue)

This case came up frequently in https://github.com/HansMuller/flutter_buttons

Copy link
Contributor

@johnsonmh johnsonmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Lgtm

@HansMuller HansMuller merged commit 7ba5078 into flutter:master May 8, 2020
@HansMuller HansMuller deleted the material_state_property_all branch May 8, 2020 01:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants