-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update NavigationBar to support Material 3 token
#98285
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
Update NavigationBar to support Material 3 token
#98285
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.
When we were working on this with designers, I believe this component (and the app bar) were supposed to have no shadow but still receive a surface overlay. It appears the tokens do not indicate this though.
I've messaged designers to see what the deal is exactly and I'll CC you Darren.
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.
Thx. It would be nice to have this somehow encoded in the tokens. We need the elevation for the overlay calculation, so it might make sense to have a useShadow or such in the tokens that we would mirror in the Material widget.
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.
According to our designer, the current way this is indicated is that a .shadow-color token is present when there should be a shadow. However for the navigation bar, it is present but that is a bug. So that should get fixed in another version of the tokens. It's a bit of hacky logic however
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.
What about just changing the value of the .shadow-color token to transparent for the navigationbar? That would be way less hacky / confusing I think.
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.
Since this widget is still fairly new, if it is possible to remove these defaults that would make the code more straightforward (they dont actually follow any spec as they were sort of a in-between M2 and M3 thing)
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 wasn't sure how many people had been using this widget, so I didn't want to break anyone. I would be more than happy to just ditch the pre-M2 settings if this isn't an issue for anyone.
…he indicator that changed.
…w defaults are used for M3.
… that it's implementation isn't tied to the NavigationBar.
HansMuller
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
NavigationBar to support Material 3 token
Part of: #91605
Updated
NavigationBarwidget to support Material Design 3 tokens. The NavigationBar is a Material 3 widget, but the current implementation doesn't match the latest spec and doesn't use the generated token values for defaults. This PR adds support for this.In order to not break anyone currently using this widget, the new support is gated by
ThemeData.useMaterial3flag. To use theNavigationBarwith the Material 3 token defaults, turn on theuseMaterial3flag in theThemeData:This also adds new
elevationandindicatorShapeparameters to theNavigationBarThemeData.