Skip to content

[material_ui] Respect ColorScheme.scrim in Drawer, ModalBottomSheet, and Dialog barriers - #12474

Open
JayeshJain25 wants to merge 1 commit into
flutter:mainfrom
JayeshJain25:fix-material-scrim-color-190824
Open

[material_ui] Respect ColorScheme.scrim in Drawer, ModalBottomSheet, and Dialog barriers#12474
JayeshJain25 wants to merge 1 commit into
flutter:mainfrom
JayeshJain25:fix-material-scrim-color-190824

Conversation

@JayeshJain25

Copy link
Copy Markdown

Drawer's scrim, showModalBottomSheet's barrier, and showDialog's barrier all hardcode Colors.black54 and never look at ColorScheme.scrim, so a custom scrim set via ColorScheme.fromSeed(..., scrim: ...) (or any ColorScheme constructor) is silently ignored.

Each of the three fallback chains now ends in colorScheme.scrim at the same alpha that Colors.black54 used, instead of the literal color. ColorScheme.scrim defaults to opaque black, so default app behavior is unchanged; a custom scrim color is now honored, matching the behavior described in the issue.

This is a port of flutter/flutter#191150, which was filed against flutter/flutter before Material/Cupertino were frozen there (per #188444). That PR is being closed in favor of this one.

Fixes #190824

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

…riers

Drawer's scrim, showModalBottomSheet's barrier, and showDialog's barrier
all hardcoded Colors.black54 and ignored a custom ColorScheme.scrim.
Each now falls back to colorScheme.scrim at the same alpha instead of
the literal black54, so default behavior is unchanged but a custom
scrim color set via ColorScheme.fromSeed(..., scrim: ...) is honored.

Fixes #190824

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates Drawer, showModalBottomSheet, and showDialog to respect ColorScheme.scrim as a fallback instead of defaulting directly to Colors.black54 when no custom barrier or scrim color is provided. Corresponding widget tests have been added to verify this behavior across all three components, and a pending changelog entry has been created. There are no review comments, so I have no feedback to provide.

@Piinks Piinks added triage-design Should be looked at in design triage and removed triage-framework Should be looked at in framework triage labels Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants