-
Notifications
You must be signed in to change notification settings - Fork 72
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
SurfaceTintColor parameter added to control background color more clean #156
Conversation
Thanks for the PR. The |
/// If null, [WoltModalSheet] will not display an overlay color. | ||
/// | ||
/// See [Material.surfaceTintColor] for more details. | ||
final Color? surfaceTintColor; |
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.
It looks like the documentation I provided in the existing source code is wrong. Let's fix this here, and in the old place. Here is my suggestion:
/// The color of the surface tint overlay applied to the material color
/// to indicate elevation for the modal sheet page. The [surfaceTintColor] is applied to the
/// modal sheet background color, top bar color, and the sticky action bar wrapper colors.
///
/// {@template flutter.material.material.surfaceTintColor}
/// Material Design 3 introduced a new way for some components to indicate
/// their elevation by using a surface tint color overlay on top of the
/// base material [color]. This overlay is painted with an opacity that is
/// related to the [elevation] of the material.
///
/// If [ThemeData.useMaterial3] is false, then this property is not used.
///
/// If [ThemeData.useMaterial3] is true and [surfaceTintColor] is not null and
/// not [Colors.transparent], then it will be used to overlay the base [backgroundColor]
/// with an opacity based on the [modalElevation].
///
/// If [ThemeData.useMaterial3] is true and [surfaceTintColor] is null, then the default
/// [surfaceTintColor] value is taken from the [ColorScheme].
///
/// See also:
///
/// * [ThemeData.useMaterial3], which turns this feature on.
/// * [ElevationOverlay.applySurfaceTint], which is used to implement the
/// tint.
/// * https://m3.material.io/styles/color/the-color-system/color-roles
/// which specifies how the overlay is applied.
6cbb21f
to
983597c
Compare
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.
Head branch was pushed to by a user without write access
Description
The surfaceTintColor parameter must be changed to see the same tone of color that is set for the background. Because the barrierColor value for the BottomSheet is defaulted to Colors.black54.
SurfaceTintColor can also be modified in WoltModalSheetThemeData for further customization.
Check how the white color looks on the background in the preview image.
Related Issues
Fix #139
Preview
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process.
///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?