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

Corrected a ChipTheme labelStyle corner case #94818

Conversation

HansMuller
Copy link
Contributor

If the theme's ChipTheme is defined with a TextStyle with inherit:true (the default), the DefaultTextStyle.style that wraps the label widget should also be inherit:true. The ChipTheme merge had been set up incorrectly and so this wasn't happening. It wasn't particularly noticeable because the default labelStyle has inherit:false.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Dec 7, 2021
?? theme.chipTheme.labelStyle;
final TextStyle labelStyle = chipTheme.labelStyle
?? theme.chipTheme.labelStyle
?? chipDefaults.labelStyle!;
Copy link
Contributor

Choose a reason for hiding this comment

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

When can this be null?

Copy link
Contributor Author

@HansMuller HansMuller Dec 7, 2021

Choose a reason for hiding this comment

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

ChipThemeData is now like the other theme data classes: all properties are null by default. You set them to override the default that's computed by the component.

The value of chipDefaults.labelStyle! can't be null ofcourse, chipDefaults is the internal representation of the default values for most properties.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@fluttergithubbot fluttergithubbot merged commit a791741 into flutter:master Dec 8, 2021
@HansMuller HansMuller deleted the update_chip_theme_label_style_init branch December 13, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

3 participants