-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Fix: CupertinoSheetTransition should change SystemUIOverlayStyle based on theme #164680
base: master
Are you sure you want to change the base?
Fix: CupertinoSheetTransition should change SystemUIOverlayStyle based on theme #164680
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
final bool isDarkMode = CupertinoTheme.brightnessOf(context) == Brightness.dark; | ||
final Color overlayColor = isDarkMode ? const Color(0xFFc8c8c8) : const Color(0xFF000000); | ||
|
||
SystemChrome.setSystemUIOverlayStyle( | ||
isDarkMode ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark, |
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 isn't quite the correct function, as the sheet needs to set the SystemUIOverlayStyle to light regardless of theme. Since when the sheet is opened, the system UI overlay is always on a black background.
The problem is that this delegated transition is wrapped around the previous route, and does not go away when the sheet is popped. The delegated transition is waiting to be played again. It might be better to move the call to setSystemUIOverlayStyle to one of the sheet's build methods. Or wrap this call here with if (!secondaryAnimation.isDismissed)
might work.
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.
Ohh, yes correct. So, it should be SystemUIOverlayStyle.light
when sheet is visible. Otherwise inverse of theme.
d523577
to
199799e
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.
LGTM, but needs a test.
199799e
to
5ad753e
Compare
5ad753e
to
f46c51b
Compare
Fix: CupertinoSheetTransition should change SystemUIOverlayStyle based on theme
fixes: #164633
Pre-launch Checklist
///
).