Flutter: Force modalBottomSheet to only close on button click

445 Views Asked by At

I am using a modalBottomSheet to store my user's settings profile. I want to perform a firebase operation on close of the bottom sheet. Is there a way to disable all modalBottomSheet gestures to force the sheet to only close on an icon onTap operation? Thanks

1

There are 1 best solutions below

1
On BEST ANSWER

You can set isDismissible and enableDrag to false.

showModalBottomSheet(
    context: context,
    isDismissible: false,
    enableDrag: false,
    builder: (context) => BottomSheetWidget(),
);