Reland "ChipThemeData is now conventional" #94179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relands #93452.
ChipThemeData is now conventional: all of its properties are default null and they define overrides of the defaults defined by the Chip widgets. Default overrides in priority order are (as usual):
All of the ChipThemeData constructor parameters and properties are now nullable. Other than that and the change to the default value of
ThemeData.chipTheme
, this change is intended to be backwards compatible.Addresses the "theme normalization" sub project within #91772
G3 Fix
This PR requires two small (Google internal) changes: cl/412111154
Breaking Change
There is a small chance that this PR will break existing apps which depend on the default value of the overall Theme's chipTheme.
The default value of
Theme.of(context).chipTheme
had been a ChipThemeData constructed like this:This ensured that all of the properties of the chip theme returned by
Theme.of(context).chipTheme
were non-null. This rarely matters in application code and the defaults for all chip properties have not changed.To remedy an app that has such a dependency, one can initialize the theme with the original default
chipTheme
value. For example:Generally speaking, it's preferable to use the theme's colorScheme and textTheme to lookup colors and text styles.