Skip to content

Conversation

@MitchellGoodwin
Copy link
Contributor

#164680 caused a regression where the systemUIStyle would not be set correctly if the previous page has a navbar.

Screen.Recording.2025-05-01.at.4.00.48.PM.mov

This happens because the RenderView is constantly watching for AnnotatedRegions at the top of the bottom of the screen to set the UI style. So the sheet when initialized would set the style, but during the transition the previous pages navbar is still at the top of the screen, so the RenderView immediately sets the style back to where it was.

This PR fixes that by adding an AnnotatedRegion behind the previous page through the delegatedTransition with the style set correctly for the sheet. That way when the previous page drops low enough, the systemUI switches over.

Screen.Recording.2025-05-01.at.3.57.39.PM.mov

The RenderView is watching for right around the midpoint of the systemUI so it switches back and forth at a good point when the transition is manually dragged back and forth.

Screen.Recording.2025-05-01.at.4.02.24.PM.mov

Pre-launch Checklist

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 May 1, 2025
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

That's pretty clever. I don't see why not. Maybe someone has stronger opinions on AnnotatedRegion and nav bars than me, but to me it seems like a pretty canonical use of AnnotatedRegion.

If not this, then we'd have to do something like have the previous page know that it's in a CupertinoBottomSheet and modify its own AnnotatedRegion? Or did you have any other ideas?

Thank you for the very clear PR description by the way 👍

Comment on lines +283 to +284
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know this will always be the right brightness? Even in dark mode? It looks like where we do something similar in AppBar, we resolve the overlay style based on potential theme settings and color choices.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the background is always black in both light and dark mode, since it's the background "behind" the app on the device.

@dkwingsmt
Copy link
Contributor

A great change, since AnnotatedRegion seems to have always been the preferred way over explicit setSystemUIOverlayStyle calls :) (link)

@MitchellGoodwin MitchellGoodwin marked this pull request as ready for review May 12, 2025 23:39
@MitchellGoodwin MitchellGoodwin requested a review from dkwingsmt May 13, 2025 21:17
Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label May 14, 2025
@auto-submit auto-submit bot added this pull request to the merge queue May 14, 2025
Merged via the queue into flutter:master with commit 0cf1d34 May 14, 2025
76 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 15, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 15, 2025
flutter/flutter@0b9f928...9a78af5

2025-05-15 bkonyi@google.com Manual pub package roll (flutter/flutter#168916)
2025-05-15 matanlurey@users.noreply.github.com Remove unnecessary `bringup: true` for release-channel only `Linux flutter_packaging`. (flutter/flutter#168761)
2025-05-15 matanlurey@users.noreply.github.com Revert: "Run `flutter_packaging` builders on release candidates (flutter/flutter#168917)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from a6c25e31caa7 to c9640c3a4440 (1 revision) (flutter/flutter#168911)
2025-05-15 engine-flutter-autoroll@skia.org Roll Packages from 1468581 to 2dff621 (4 revisions) (flutter/flutter#168908)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from b3520981e0f0 to a6c25e31caa7 (11 revisions) (flutter/flutter#168895)
2025-05-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fSvuEJgRmHxnewRJr... to Jj-iDG5uPOsFgY2_H... (flutter/flutter#168893)
2025-05-15 jsimionato@google.com Fix mac_ios_engine_ddm config with missing ci/ios_debug_sim_ddm config (flutter/flutter#168888)
2025-05-15 dacoharkes@google.com [native assets] Remove `KernelSnapshot` dependency in build (flutter/flutter#168742)
2025-05-15 chris@bracken.jp iOS,macOS: Migrate logging to Logger/FlutterLogger (flutter/flutter#168568)
2025-05-15 58529443+srujzs@users.noreply.github.com Skip hot reload breakpoints test when running with web (flutter/flutter#168873)
2025-05-15 victorsanniay@gmail.com CupertinoSliverNavigationBar respects accessibility text scaling (flutter/flutter#168866)
2025-05-15 jonahwilliams@google.com [display_list] paint cleanup. (flutter/flutter#168082)
2025-05-15 jsimionato@google.com Add a new CI build for iOS DDM-enabled artifacts (flutter/flutter#168717)
2025-05-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396)" (flutter/flutter#168880)
2025-05-14 30870216+gaaclarke@users.noreply.github.com Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (flutter/flutter#168396)
2025-05-14 matanlurey@users.noreply.github.com Mark web_tool_tests_1_2 as bringup. (flutter/flutter#168871)
2025-05-14 fluttergithubbot@gmail.com Marks Mac_mokey run_debug_test_android to be unflaky (flutter/flutter#167634)
2025-05-14 victorsanniay@gmail.com Reland "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions" (flutter/flutter#168772)
2025-05-14 matanlurey@users.noreply.github.com Remove references to `team-release`. (flutter/flutter#168780)
2025-05-14 58190796+MitchellGoodwin@users.noreply.github.com Make Cupertino sheet set the systemUIStyle through an AnnotatedRegion (flutter/flutter#168182)
2025-05-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use live region in error text input decorator for Android (#165531)" (flutter/flutter#168848)
2025-05-14 huy@nevercode.io Normalize BottomAppBarTheme (flutter/flutter#168586)
2025-05-14 engine-flutter-autoroll@skia.org Roll Packages from 2e166de to 1468581 (2 revisions) (flutter/flutter#168828)
2025-05-14 chris@bracken.jp macOS,iOS: fix swift target triple (flutter/flutter#168749)
2025-05-14 matanlurey@users.noreply.github.com Further update `Engine-artifacts.md`. (flutter/flutter#168779)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
flutter/flutter@0b9f928...9a78af5

2025-05-15 bkonyi@google.com Manual pub package roll (flutter/flutter#168916)
2025-05-15 matanlurey@users.noreply.github.com Remove unnecessary `bringup: true` for release-channel only `Linux flutter_packaging`. (flutter/flutter#168761)
2025-05-15 matanlurey@users.noreply.github.com Revert: "Run `flutter_packaging` builders on release candidates (flutter/flutter#168917)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from a6c25e31caa7 to c9640c3a4440 (1 revision) (flutter/flutter#168911)
2025-05-15 engine-flutter-autoroll@skia.org Roll Packages from 1468581 to 2dff621 (4 revisions) (flutter/flutter#168908)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from b3520981e0f0 to a6c25e31caa7 (11 revisions) (flutter/flutter#168895)
2025-05-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fSvuEJgRmHxnewRJr... to Jj-iDG5uPOsFgY2_H... (flutter/flutter#168893)
2025-05-15 jsimionato@google.com Fix mac_ios_engine_ddm config with missing ci/ios_debug_sim_ddm config (flutter/flutter#168888)
2025-05-15 dacoharkes@google.com [native assets] Remove `KernelSnapshot` dependency in build (flutter/flutter#168742)
2025-05-15 chris@bracken.jp iOS,macOS: Migrate logging to Logger/FlutterLogger (flutter/flutter#168568)
2025-05-15 58529443+srujzs@users.noreply.github.com Skip hot reload breakpoints test when running with web (flutter/flutter#168873)
2025-05-15 victorsanniay@gmail.com CupertinoSliverNavigationBar respects accessibility text scaling (flutter/flutter#168866)
2025-05-15 jonahwilliams@google.com [display_list] paint cleanup. (flutter/flutter#168082)
2025-05-15 jsimionato@google.com Add a new CI build for iOS DDM-enabled artifacts (flutter/flutter#168717)
2025-05-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396)" (flutter/flutter#168880)
2025-05-14 30870216+gaaclarke@users.noreply.github.com Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (flutter/flutter#168396)
2025-05-14 matanlurey@users.noreply.github.com Mark web_tool_tests_1_2 as bringup. (flutter/flutter#168871)
2025-05-14 fluttergithubbot@gmail.com Marks Mac_mokey run_debug_test_android to be unflaky (flutter/flutter#167634)
2025-05-14 victorsanniay@gmail.com Reland "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions" (flutter/flutter#168772)
2025-05-14 matanlurey@users.noreply.github.com Remove references to `team-release`. (flutter/flutter#168780)
2025-05-14 58190796+MitchellGoodwin@users.noreply.github.com Make Cupertino sheet set the systemUIStyle through an AnnotatedRegion (flutter/flutter#168182)
2025-05-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use live region in error text input decorator for Android (#165531)" (flutter/flutter#168848)
2025-05-14 huy@nevercode.io Normalize BottomAppBarTheme (flutter/flutter#168586)
2025-05-14 engine-flutter-autoroll@skia.org Roll Packages from 2e166de to 1468581 (2 revisions) (flutter/flutter#168828)
2025-05-14 chris@bracken.jp macOS,iOS: fix swift target triple (flutter/flutter#168749)
2025-05-14 matanlurey@users.noreply.github.com Further update `Engine-artifacts.md`. (flutter/flutter#168779)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
flutter/flutter@0b9f928...9a78af5

2025-05-15 bkonyi@google.com Manual pub package roll (flutter/flutter#168916)
2025-05-15 matanlurey@users.noreply.github.com Remove unnecessary `bringup: true` for release-channel only `Linux flutter_packaging`. (flutter/flutter#168761)
2025-05-15 matanlurey@users.noreply.github.com Revert: "Run `flutter_packaging` builders on release candidates (flutter/flutter#168917)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from a6c25e31caa7 to c9640c3a4440 (1 revision) (flutter/flutter#168911)
2025-05-15 engine-flutter-autoroll@skia.org Roll Packages from 1468581 to 2dff621 (4 revisions) (flutter/flutter#168908)
2025-05-15 engine-flutter-autoroll@skia.org Roll Dart SDK from b3520981e0f0 to a6c25e31caa7 (11 revisions) (flutter/flutter#168895)
2025-05-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fSvuEJgRmHxnewRJr... to Jj-iDG5uPOsFgY2_H... (flutter/flutter#168893)
2025-05-15 jsimionato@google.com Fix mac_ios_engine_ddm config with missing ci/ios_debug_sim_ddm config (flutter/flutter#168888)
2025-05-15 dacoharkes@google.com [native assets] Remove `KernelSnapshot` dependency in build (flutter/flutter#168742)
2025-05-15 chris@bracken.jp iOS,macOS: Migrate logging to Logger/FlutterLogger (flutter/flutter#168568)
2025-05-15 58529443+srujzs@users.noreply.github.com Skip hot reload breakpoints test when running with web (flutter/flutter#168873)
2025-05-15 victorsanniay@gmail.com CupertinoSliverNavigationBar respects accessibility text scaling (flutter/flutter#168866)
2025-05-15 jonahwilliams@google.com [display_list] paint cleanup. (flutter/flutter#168082)
2025-05-15 jsimionato@google.com Add a new CI build for iOS DDM-enabled artifacts (flutter/flutter#168717)
2025-05-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396)" (flutter/flutter#168880)
2025-05-14 30870216+gaaclarke@users.noreply.github.com Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (flutter/flutter#168396)
2025-05-14 matanlurey@users.noreply.github.com Mark web_tool_tests_1_2 as bringup. (flutter/flutter#168871)
2025-05-14 fluttergithubbot@gmail.com Marks Mac_mokey run_debug_test_android to be unflaky (flutter/flutter#167634)
2025-05-14 victorsanniay@gmail.com Reland "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions" (flutter/flutter#168772)
2025-05-14 matanlurey@users.noreply.github.com Remove references to `team-release`. (flutter/flutter#168780)
2025-05-14 58190796+MitchellGoodwin@users.noreply.github.com Make Cupertino sheet set the systemUIStyle through an AnnotatedRegion (flutter/flutter#168182)
2025-05-14 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use live region in error text input decorator for Android (#165531)" (flutter/flutter#168848)
2025-05-14 huy@nevercode.io Normalize BottomAppBarTheme (flutter/flutter#168586)
2025-05-14 engine-flutter-autoroll@skia.org Roll Packages from 2e166de to 1468581 (2 revisions) (flutter/flutter#168828)
2025-05-14 chris@bracken.jp macOS,iOS: fix swift target triple (flutter/flutter#168749)
2025-05-14 matanlurey@users.noreply.github.com Further update `Engine-artifacts.md`. (flutter/flutter#168779)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
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.

4 participants