-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update MaterialBanner to support Material 3
#105957
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
d96ae2a to
c3055c7
Compare
|
Just resolved template conflicts. |
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.
I see there are more properties (like actions, containerHeight, divider) in the token file. Should we add them in themeData too?
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.
Apologies for the delay.
actions parameter takes a list of widgets so the styling depends on the widget provided.
containerHeight aka min height isn't customizable currently, there are container height tokens for desktop and mobile. I would prefer to work in a separate PR after Banner is available on https://m3.material.io/.
Added divider color and other existing missing properties tests.
f0c16eb to
529436d
Compare
bleroux
left a comment
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 with small nit
hannah-hyj
left a comment
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
4d25b43 to
26c1561
Compare
| Color? get backgroundColor => _theme.colorScheme.surface; | ||
|
|
||
| @override | ||
| Color? get dividerColor => Theme.of(context).colorScheme.surfaceVariant; |
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.
This broke golden tests for flutter gallery, is this the correct value?
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.
Yes, based on token
| "md.comp.banner.divider.color": "surfaceVariant", |
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.
Perhaps the golden test is broken this color is added to the M2 template in this PR
Which uses Theme.dividerColor
| ?? (context != null ? (DividerTheme.of(context).color ?? Theme.of(context).dividerColor) : 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.
I can revert this PR or remove the divider color from the M2 template.
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.
Okay, thanks. Since this is not breaking per the breaking change policy, and is effectively a fix so let's hold off unless there's a need to revert due to Google-internal usages.
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.
Thanks for the update!
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.
@TahaTesser Actually the "banner.json" token file is only for M3. I think you should remove the divider color from the M2 template.
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.
@TahaTesser Hi Taha, We are reverting this PR in #111288 because it caused some scuba breakages to google3. Please create another PR for this, thanks!
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.
Thank you @Hangyujin! My bad I should have been careful with the M2 template.
* 5bb612c Roll Flutter Engine from 14eb83a7d0bd to a8e97892ce25 (1 revision) (flutter/flutter#110938) * 798ce22 Roll Flutter Engine from a8e97892ce25 to 0a2f56cd025f (1 revision) (flutter/flutter#110940) * 5de91d9 Roll Flutter Engine from 0a2f56cd025f to b040ed90175b (1 revision) (flutter/flutter#110954) * 202f577 Roll Flutter Engine from b040ed90175b to b94120dfe9c6 (1 revision) (flutter/flutter#110960) * d8fdb83 Update `MaterialBanner` to support Material 3 (flutter/flutter#105957) * fbba194 Migrate `ListTile` disabled icon color to Material 3 (flutter/flutter#102078) * f625359 Roll Flutter Engine from b94120dfe9c6 to 5a2861e499d2 (1 revision) (flutter/flutter#110972) * eb154d5 Roll Flutter Engine from 5a2861e499d2 to 3ff25eb9081c (1 revision) (flutter/flutter#110974) * 0144110 Roll Flutter Engine from 3ff25eb9081c to 47c281f218db (1 revision) (flutter/flutter#110983) * b166390 Roll Flutter Engine from 47c281f218db to 25642a45a55e (1 revision) (flutter/flutter#110991) * bce9163 Roll Flutter Engine from 25642a45a55e to 7b3710878503 (1 revision) (flutter/flutter#110992) * 8cddac7 Roll Flutter Engine from 7b3710878503 to 3c0898c0dfed (1 revision) (flutter/flutter#110993) * 96345a4 Roll Flutter Engine from 3c0898c0dfed to ddc5bb330254 (1 revision) (flutter/flutter#110999) * 723b82e Feat: dSYM debug info for iOS & macOS builds (flutter/flutter#101586)
| Color? get dividerColor => Theme.of(context).colorScheme.surfaceVariant; | ||
|
|
||
| @override | ||
| TextStyle? get contentTextStyle => _theme.textTheme.bodyText2; |
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.
I think it should also be "theme.textTheme.bodyMedium" in M2
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.
Yep, I was gonna make this since it just points to bodyMedium anyways.
This reverts commit d8fdb83.
* 5bb612c Roll Flutter Engine from 14eb83a7d0bd to a8e97892ce25 (1 revision) (flutter/flutter#110938) * 798ce22 Roll Flutter Engine from a8e97892ce25 to 0a2f56cd025f (1 revision) (flutter/flutter#110940) * 5de91d9 Roll Flutter Engine from 0a2f56cd025f to b040ed90175b (1 revision) (flutter/flutter#110954) * 202f577 Roll Flutter Engine from b040ed90175b to b94120dfe9c6 (1 revision) (flutter/flutter#110960) * d8fdb83 Update `MaterialBanner` to support Material 3 (flutter/flutter#105957) * fbba194 Migrate `ListTile` disabled icon color to Material 3 (flutter/flutter#102078) * f625359 Roll Flutter Engine from b94120dfe9c6 to 5a2861e499d2 (1 revision) (flutter/flutter#110972) * eb154d5 Roll Flutter Engine from 5a2861e499d2 to 3ff25eb9081c (1 revision) (flutter/flutter#110974) * 0144110 Roll Flutter Engine from 3ff25eb9081c to 47c281f218db (1 revision) (flutter/flutter#110983) * b166390 Roll Flutter Engine from 47c281f218db to 25642a45a55e (1 revision) (flutter/flutter#110991) * bce9163 Roll Flutter Engine from 25642a45a55e to 7b3710878503 (1 revision) (flutter/flutter#110992) * 8cddac7 Roll Flutter Engine from 7b3710878503 to 3c0898c0dfed (1 revision) (flutter/flutter#110993) * 96345a4 Roll Flutter Engine from 3c0898c0dfed to ddc5bb330254 (1 revision) (flutter/flutter#110999) * 723b82e Feat: dSYM debug info for iOS & macOS builds (flutter/flutter#101586)
* 5bb612c Roll Flutter Engine from 14eb83a7d0bd to a8e97892ce25 (1 revision) (flutter/flutter#110938) * 798ce22 Roll Flutter Engine from a8e97892ce25 to 0a2f56cd025f (1 revision) (flutter/flutter#110940) * 5de91d9 Roll Flutter Engine from 0a2f56cd025f to b040ed90175b (1 revision) (flutter/flutter#110954) * 202f577 Roll Flutter Engine from b040ed90175b to b94120dfe9c6 (1 revision) (flutter/flutter#110960) * d8fdb83 Update `MaterialBanner` to support Material 3 (flutter/flutter#105957) * fbba194 Migrate `ListTile` disabled icon color to Material 3 (flutter/flutter#102078) * f625359 Roll Flutter Engine from b94120dfe9c6 to 5a2861e499d2 (1 revision) (flutter/flutter#110972) * eb154d5 Roll Flutter Engine from 5a2861e499d2 to 3ff25eb9081c (1 revision) (flutter/flutter#110974) * 0144110 Roll Flutter Engine from 3ff25eb9081c to 47c281f218db (1 revision) (flutter/flutter#110983) * b166390 Roll Flutter Engine from 47c281f218db to 25642a45a55e (1 revision) (flutter/flutter#110991) * bce9163 Roll Flutter Engine from 25642a45a55e to 7b3710878503 (1 revision) (flutter/flutter#110992) * 8cddac7 Roll Flutter Engine from 7b3710878503 to 3c0898c0dfed (1 revision) (flutter/flutter#110993) * 96345a4 Roll Flutter Engine from 3c0898c0dfed to ddc5bb330254 (1 revision) (flutter/flutter#110999) * 723b82e Feat: dSYM debug info for iOS & macOS builds (flutter/flutter#101586)
fixes #105594
minimal code sample
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.