Skip to content

Conversation

@Kavantix
Copy link
Contributor

@Kavantix Kavantix commented Sep 21, 2020

Description

Currently showModalBottomSheet always removes the top padding from the MediaQuery since it would be 'consumed' since the bottomsheet wont span the entire height of the window.
This is however only correct if the sheet is not scroll controlled, because if it is scroll controlled then the bottomsheet will get a maximum size of the whole window again.
So this PR makes showModalBottomSheet actually consume the padding if the bottomsheet is scrollcontrolled.

Related Issues

Fixes #39205

Tests

I added the following tests:

  • Updated the name of the old test to indicate that it should only happen if not scroll controlled
  • Added a new test that checks that the bottomsheet is inset by the top padding

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

Not sure if this is considered a breaking, I don't think any tests will fail but anyone that is using a workaround like proposed in #39205 will get a double padding by this fix

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 21, 2020
@Kavantix
Copy link
Contributor Author

Not sure if this is considered a breaking, I don't think any tests will fail but anyone that is using a workaround like proposed in #39205 will get a double padding by this fix

@HansMuller HansMuller requested a review from Piinks September 24, 2020 23:41
@Piinks
Copy link
Contributor

Piinks commented Oct 7, 2020

Not sure if this is considered a breaking, I don't think any tests will fail but anyone that is using a workaround like proposed in #39205 will get a double padding by this fix

This does not break any existing flutter or customer tests, so it does not appear to be breaking. :) Once approved, we can run it through google testing to be sure.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM
Thanks for the contribution!

@Piinks
Copy link
Contributor

Piinks commented Oct 7, 2020

Triage note: I'm waiting on the google testing shard to start before applying the auto-merge label.

@Piinks
Copy link
Contributor

Piinks commented Oct 30, 2020

@Kavantix it looks like this wasn't merged due to a tree closure, and now there are merge conflicts. Can you update this so we can land your change? Thank you!

@Kavantix Kavantix force-pushed the bottomsheet-top-padding branch from 16bb28c to 6e897ed Compare November 2, 2020 17:58
@Kavantix
Copy link
Contributor Author

Kavantix commented Nov 2, 2020

@Piinks just rebased it on master

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

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModalBottomSheet with isScrollControlled doesn't respect SafeArea

5 participants