Skip to content

Make component theme data defaults use WidgetStateProperty #173893

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ValentinVignal
Copy link
Contributor

Coming from the comments in #173160 (comment)

MaterialStateProperty is deprecated. This PR remplaces its usage with WidgetStateProperty for the files that generates component theme data defaults

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: focus Focus traversal, gaining or losing focus labels Aug 16, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly replaces many instances of the deprecated MaterialStateProperty with WidgetStateProperty. However, the refactoring appears to be incomplete. Numerous instances of MaterialStatePropertyAll remain, which should be replaced with WidgetStatePropertyAll to fully address the deprecation. While I cannot comment on specific lines because they are not part of the diff, a global search for MaterialStatePropertyAll should reveal the remaining instances that need to be updated. Completing this will make the refactoring whole.

@ValentinVignal ValentinVignal force-pushed the flutter/make-default-use-widget-state-property branch from 6b4d647 to a8ac0d3 Compare August 18, 2025 04:11
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Thank you for cleaning this up! LGTM but I just want to double check with @MitchellGoodwin that we didn't defer this migration for a reason.

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

LGTM! These properties were not migrated over immediately because we were watching community reactions to the WidgetStateProperty migration in general, and didn't want to add confusion. I think it's perfectly fine to migrate these over now, and thank you for doing so.

@ValentinVignal ValentinVignal force-pushed the flutter/make-default-use-widget-state-property branch from a8ac0d3 to 36b062f Compare August 19, 2025 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems f: focus Focus traversal, gaining or losing focus f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants