-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add support for surface tint color overlays to Material widget.
#100036
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
Merged
darrenaustin
merged 3 commits into
flutter:master
from
darrenaustin:m3_elevation_overlay
Mar 17, 2022
Merged
Add support for surface tint color overlays to Material widget.
#100036
darrenaustin
merged 3 commits into
flutter:master
from
darrenaustin:m3_elevation_overlay
Mar 17, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guidezpl
reviewed
Mar 14, 2022
8 tasks
HansMuller
approved these changes
Mar 16, 2022
Contributor
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
In a future PR it would help to include an example that generated the illustration in this PR's description, along with a switch for dark/light mode.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Mar 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Mar 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Mar 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c: contributor-productivity
Team-specific productivity, code health, technical debt.
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
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.
As part of the Material 3 Migration, this PR adds support for the new surface tint overlay feature to the
Materialwidget. If a newsurfaceTintColoris provided to theMaterialwidget it will apply this color to the base color with an opacity based on theelevation. This is described in detail in the Material 3 spec.In order to use this new feature you must opt-in with the
useMaterial3flag:Then you can use the new
surfaceTintColorto turn on an overlay for the given Material widget:This PR also changes the default value for
Material.shadowColorwhenThemeData.useMaterial3is true. Previous to Material 3, ifshadowColorwas null it would default toThemeData.shadowColor. For Material 3 in some situations we need to be able to turn off the drop shadow even if there is an elevation. Therefore ifThemeData.useMaterial3is true andshadowColoris null then no drop shadow will be rendered.Existing M2 tests were moved to their own group and new M3 tests were added.
Fixes: #91607
Pre-launch Checklist
///).