modal_bottom_sheet
modal_bottom_sheet copied to clipboard
On navigator.pop (not an issue)
Is there a way to detect whether ModalBottomSheet is closed by tapping on the rest of the screen? I need to invoke some functions on this moment.
You can wrap you modal widget in a WillPopScope:
WillPopScope(
onWillPop: () async {
// TODO
},
child: Scaffold(
// ...
)
)
However, this will not differentiate between closing the modal by tapping outside of it and dragging it down. Maybe this helps.