Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adjust padding for Cupertino sheet content#162481

Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom
MitchellGoodwin:sheet-padding
Feb 4, 2025
Merged

Adjust padding for Cupertino sheet content#162481
auto-submit[bot] merged 2 commits intoflutter:masterfrom
MitchellGoodwin:sheet-padding

Conversation

@MitchellGoodwin
Copy link
Contributor

Fixes#162215 and partially supports#162181.

The Cupertino sheet had two issues layout: It still had MediaQuery padding at the top of the screen as if there was safe area content to avoid and some of the sheet was permanently offscreen. This caused a FloatingActionButton to be clipped, but if you put a scrolling widget in the sheet with text at the very bottom, it was impossible to scroll the text into view. This PR removes the top padding, and changes the bottom padding to equal the amount offscreen.

Before:
Screenshot 2025-01-30 at 11 21 36 AM

After:
Screenshot 2025-01-30 at 11 19 54 AM

Pre-launch Checklist

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

@github-actionsgithub-actionsbot added frameworkflutter/packages/flutter repository. See also f: labels. f: cupertinoflutter/packages/flutter/cupertino repository labelsJan 30, 2025
Copy link
Contributor

@justinmcjustinmc left a comment

Choose a reason for hiding this comment

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

LGTM with nits 👍

Looks like you have an analyzer failure FYI.

child: _CupertinoSheetScope(child: builder(context)),
final double bottomPadding = MediaQuery.sizeOf(context).height * _kTopGapRatio;

return MediaQuery.removePadding(
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't realize MediaQuery.removePadding was a thing, nice.

Comment on lines +15 to +16
// of the total height of the screen. Found from eyeballing a simulator running
// iOS 18.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Have you tried this PR out on iPad? If not and you have time maybe give it a shot, just to double check that this proportion still looks ok on the bigger screen.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It looks ok. Natively sheets adapt to a modal type view though. So there's nothing to compare against.
Screenshot 2025-01-31 at 2 15 12 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I didn't realize that. Should we consider doing something similar?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I'll create an issue for it, but I think it's going to be p3.

justinmc reacted with thumbs up emoji
// Devide by size of the sheet. The gap between the top of the sheet and
// top of the screen is 0.08.
details.primaryDelta! / (context.size!.height - (context.size!.height * topGapRatio)),
// Devide by size of the sheet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "Divide"

await tester.tap(find.text('Push Page 2'));
await tester.pumpAndSettle();

expect(tester.getSize(find.byType(Container)).height, 600.0 - (600.0 * 0.08));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe declare a _kTopGapRatio variable in the test and use it here, just so it's more obvious where the 0.08 comes from.

@MitchellGoodwinMitchellGoodwinforce-pushed thesheet-padding branch 2 times, most recently fromfab2553 to10cf540CompareFebruary 3, 2025 19:48
@MitchellGoodwinMitchellGoodwin added the autosubmitMerge PR when tree becomes green via auto submit App labelFeb 4, 2025
@auto-submitauto-submitbot added this pull request to themerge queueFeb 4, 2025
Merged via the queue intoflutter:master with commitccae8ccFeb 4, 2025
77 checks passed
@flutter-dashboardflutter-dashboardbot removed the autosubmitMerge PR when tree becomes green via auto submit App labelFeb 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestFeb 11, 2025
@muttsu-623
Copy link

Hi@MitchellGoodwin !

I've met this issue. I appreciate your work! Thank you so much ❤️

Do you know when this fix will be released 👀 ?

@MitchellGoodwin
Copy link
ContributorAuthor

Apologies, I missed this comment. This is currently on the beta build and will be a part of the next stable release. Stable release dates aren't public... But they can be guessed at by looking around 😄

muttsu-623 reacted with thumbs up emoji

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull requestMay 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@justinmcjustinmcjustinmc approved these changes

Assignees

No one assigned

Labels

f: cupertinoflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

FloatingActionButton is out of frame when trying to place it in CupertinoSheetRoute

3 participants

@MitchellGoodwin@muttsu-623@justinmc

Comments


[8]ページ先頭

©2009-2026 Movatter.jp