Breaking change: BottomSheet's child must be scrollable with primary set to true

39 views
Skip to first unread message

Dan Field

unread,
Feb 11, 2019, 12:07:20 AM2/11/19
to flutter-...@googlegroups.com, flutt...@googlegroups.com

Currently, a bottom sheet can either be dragged or have a scrollable child, but not both.

I've implemented support for this in the linked PR.  However, in order to do so I'm requiring that the child of a bottom sheet have a scrollable widget with primary set to true.  This allows a bottom sheet to be dragged vertically and scroll its child when it reaches full height.  As currently implemented, an assertion will be thrown if you try to show a bottom sheet that does not have a scrollable child.  A simple way to fix this is to wrap your existing child in a SingleChildScrollView with primary set to true.  If it is already a ListView or GridView, you should add "primary: true" to the arguments of the constructor.

I'm very open to feedback on this - if there's a work around that allows us to achieve the following without adding this requirement I think it'd be great:

  • Support dragging the bottom sheet vertically
  • Support scrolling the interior contents of the bottom sheet if its contents overflow the height of the screen (or otherwise overflow the max height of the bottom sheet)
  • Support all gestures as expected for children of the bottom sheet

Dan Field

unread,
Feb 14, 2019, 2:08:58 PM2/14/19
to flutter-...@googlegroups.com, flutt...@googlegroups.com
I'm working to make this a non-breaking, opt-in change instead, following the expert guidance of Hans Mueller and Michael Goderbauer.

I still welcome feedback on the PR and the approach, but we should be able to do this without breaking existing consumers.

Dan


--
You received this message because you are subscribed to the Google Groups "Flutter Announcements (flutter-announce)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-announ...@googlegroups.com.
To post to this group, send email to flutter-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-announce/CAPMweTR0fbYq3gTXJ%3DueUCRgCj6j84eU0-2zbqGKd9cXefAMdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "acx-mobile-announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to acx-mobile-anno...@google.com.
To view this discussion on the web visit https://groups.google.com/a/google.com/d/msgid/acx-mobile-announce/CAESXTATW6gd6yDvkq3_nPrE9SmLxcfe%3DKwbS_W40qe8Sjq8Kxw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "flutter-team" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-team...@google.com.
To post to this group, send email to flutte...@google.com.
Reply all
Reply to author
Forward
0 new messages