Skip to content
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 Android SystemUiOverlayStyle issue when showing CupertinoSheet #164511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Mairramer
Copy link
Contributor

Fixes #164134
Fixes issue where SystemUiOverlayStyle incorrectly changes on Android when showing CupertinoSheet.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Mar 3, 2025
@MitchellGoodwin
Copy link
Contributor

MitchellGoodwin commented Mar 18, 2025

#164680 is solving a similar issue.

Reiterating from the other PR: we do want to change the SystemUiOverlayStyle on both platforms. It causes the overlay to be visible when it goes from having a light background to a dark background mid transition. So if we remove it, it looks like this:

Screen.Recording.2025-03-18.at.12.11.35.PM.mov

When we want this:

Screen.Recording.2025-03-18.at.1.45.13.PM.mov

The problem is that when a sheet route is pushed, it wraps the previous route with it's delegatedTransition, which has the set SystemUiOverlayStyle. When the sheet is removed with a drag, the delegatedTransition sticks around so the overlay style wasn't being reset. The other PR fixes this by not setting it depending on the animation status.

For Android specifically, we probably don't need to ever set the bottom system UI. That could be fixed by changing the way the overlay style is set from

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);

to

SystemChrome.setSystemUIOverlayStyle(
  const SystemUiOverlayStyle(
    statusBarBrightness: Brightness.dark,
    statusBarIconBrightness: Brightness.light,
  ),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] showCupertinoSheet change navigation theme on android
2 participants