Support drag-to-dismiss in persistent bottom sheets#1997
Support drag-to-dismiss in persistent bottom sheets#1997HansMuller wants to merge 1 commit intoflutter:masterfrom HansMuller:bottom_sheet_drag
Conversation
There was a problem hiding this comment.
Rather than using a mixin, can we use an object that the state holds as a member? We should eventually share code with Drawer here. I tried to factor a bit of this logic out of Drawer and into DrawerController. We can unify with Drawer in a separate step.
There was a problem hiding this comment.
One difference between what I'm doing and DrawerController is that if the bottom sheet is animating I ignore drag gestures. This means that a lightning fingered user might find themselves unable to get in the way of an ongoing show/dismiss. But it also means that code that perhaps erroneously assumes that navigator.pop() will dismiss the sheet will never be foiled by Mr lightning fingers.
There was a problem hiding this comment.
Whatever we decide, we should probably be consistent between the two widgets.
|
LGTM but I think we might be able to share code better with a "has a" pattern rather than an "is a" pattern. |
Support drag-to-dismiss in persistent bottom sheets Flinging a persistent bottom sheet downwards dismisses it, per the Material spec. The showBottomSheet() function now returns a Future, like showModalBottomSheet() does, so that you can discover when it's been dismissed - with navigator.pop() - and with what value. Factored the drag gesture handling code into _BottomSheetDragController This CL was flutter/engine#1997
Flinging a persistent bottom sheet downwards dismisses it, per the Material spec.
The showBottomSheet() function now returns a Future, like showModalBottomSheet() does, so that you can discover when it's been dismissed - with navigator.pop() - and with what value.
Factored the drag gesture handling code into _BottomSheetDragMixin.