Skip to content

[cupertino_ui] Fix covered sheet revealing root route through top gap - #12530

Open
huahua8893 wants to merge 1 commit into
flutter:mainfrom
huahua8893:fix-cupertino-sheet
Open

[cupertino_ui] Fix covered sheet revealing root route through top gap#12530
huahua8893 wants to merge 1 commit into
flutter:mainfrom
huahua8893:fix-cupertino-sheet

Conversation

@huahua8893

Copy link
Copy Markdown

Ports flutter/flutter#187058 to cupertino_ui following flutter/flutter#188444.

Fixes flutter/flutter#187057.

When multiple CupertinoSheetRoutes are stacked, the covered sheet's top gap can reveal the root route because the top-gap padding sits outside the secondary route transition.

This change applies the covered sheet's secondary transition outside the top-gap padding, so the sheet and its gap move together. It also adds a coordinate-based regression test that verifies the root route remains fully covered.

Tests

  • flutter test test/sheet_test.dart --no-pub
  • dart run script/tool/bin/flutter_plugin_tools.dart analyze --packages cupertino_ui
  • dart run script/tool/bin/flutter_plugin_tools.dart validate --packages cupertino_ui --base-sha=252bb33ad3666c7d28621c87edccafff86e210fd --check-for-missing-changes
  • dart run script/tool/bin/flutter_plugin_tools.dart publish-check --packages cupertino_ui

Pre-Review Checklist

@github-actions github-actions Bot added p: cupertino_ui triage-design Should be looked at in design triage labels Aug 21, 2026

@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 modifies the widget tree in _CupertinoSheetTransitionState to wrap the Padding widget with _coverSheetSecondaryTransition instead of having Padding wrap the transition. This prevents lower routes from being revealed through the top gap when multiple CupertinoSheetRoutes are stacked. A new widget test has been added to verify this layout behavior, and a pending changelog entry has been created. There are no review comments to evaluate.

@huahua8893

Copy link
Copy Markdown
Author

@dkwingsmt @victorsanni This is the migrated PR from flutter/flutter#187058. Could you please review the change here? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CupertinoSheetRoute top gap can reveal lower routes when multiple sheets are stacked

1 participant