Repository navigation
fix: keep bottom sheet SafeArea inside the display-feature sub-screen - #195621
Draft
AdityaxDeore wants to merge 1 commit into
Draft
AdityaxDeore wants to merge 1 commit into
AdityaxDeore wants to merge 1 commit into
Conversation
|
This pull request contains changes to Material or Cupertino, which are currently frozen in this repository. Changes should be made in Please refer to #188444 for instructions. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
showModalBottomSheet(useSafeArea: true)subtracted the safe area of theopposite sub-screen from a sheet confined to one display-feature
sub-screen: on a 951pt-wide foldable with an 80pt right safe area, a sheet
on the left sub-screen came out 375.5pt wide instead of 455.5pt.
ModalBottomSheetRoute.buildPagewrappedDisplayFeatureSubScreenin theSafeArea.SafeAreashrinks the constraints but keepsMediaQuery.size,so the sub-screen padded in full-window coordinates inside a box that was
already narrower by the inset.
The
SafeArea(and theMediaQuery.removePaddingused whenuseSafeAreais false) is now applied inside theDisplayFeatureSubScreen,mirroring how
showDialogapplies itsSafeAreainside the sub-screen.There,
MediaQueryData.removeDisplayFeaturesalready gives each sub-screenonly the padding of its own edges, so nothing belonging to another
sub-screen is subtracted. The
useSafeArea: falsebehavior is unchanged:removePaddingstill removes the top padding, now read from thesub-screen's trimmed
MediaQuery, which yields the same result with andwithout display features.
Fixes #195218
Tests
New regression test in
bottom_sheet_test.dart(the issue's repro, placedin the existing display-features group): fails before this change with
width 375.5, passes after with width 455.5.
flutter test test/material/bottom_sheet_test.dart test/widgets/display_feature_sub_screen_test.dart: 87 passed, 0 failed.flutter analyzeon the changed files: no issues.dart format: clean.Note: this issue is labelled
triaged-design/team-designand wasrouted to the design team for evaluation with no verdict in the thread yet;
opening as a draft so the design team can weigh in. Also a draft because
the contributor already has 2 open PRs in this repo.
Pre-launch Checklist
///). (No public API changed; only an explanatory code comment was added.)If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.