-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Migrate Chips to Material 3 #107166
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
Migrate Chips to Material 3 #107166
Conversation
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
@@ -1247,6 +1310,9 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid | |||
child: result, | |||
), | |||
); | |||
// if (height != null) { |
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.
Looks like this should be removed.
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.
Yup, I had deleted it, but perhaps it snuck back in with a merge I was doing.
const _TokenDefaultsM3(this.context, this.isEnabled) | ||
: super( | ||
elevation: 0.0, | ||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(8.0), topRight: Radius.circular(8.0), bottomLeft: Radius.circular(8.0), bottomRight: Radius.circular(8.0))), |
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.
Could be BorderRadius.all(Radius.circular(8))
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.
Yup, this is a generator problem. One that will be fixed with the BottomAppBar PR.
@darrenaustin / @HansMuller Is it on purpose that plain just Seems a bit inconsistent that it does not default to the M3 styling as well when M3 is used. Is it on purpose or an oversight, or just not done yet? In any case, if left like this, I'm sure users will wonder about it and stumble over this inconsistency. |
It is more an oversight than anything else. The M3 spec doesn't describe a 'plain' chip, so i tis not obvious what "M3 styling" should apply to Flutter's generic |
Thanks @darrenaustin, looking at M3 spec I figured that might be the background too. Using same defaults as AssistChip sounds good. Even if not mentioned in M3 spec I think it would make sense in Flutter from a design consistency viewpoint. |
Part of: #91605
Updated the chip widgets
ActionChip
,FilterChip
,ChoiceChip
andInputChip
with support for Material Design 3.In order to use the chip widgets with the new Material 3 defaults, turn on the
useMaterial3
flag in theThemeData
:The names of some of the chips in Material Design 3 are a little different from the previous version. You can use the following to implement M3 designs:
ActionChip
FilterChip
orChoiceChip
(for single selection)InputChip
ActionChip
Fixes: #99024
Pre-launch Checklist
///
).