how to prevent flutter showBottomSheet from being dismissed by dragging down?
Just wrap your child with GestureDetector
and set onVerticalDragStart: (_) {}
,
showBottomSheet(
context: context,
builder: (context) => GestureDetector(
child: *your_widget*,
onVerticalDragStart: (_) {},
),
);
If you use showModalBottomSheet
, simply use enableDrag
property:
showModalBottomSheet(
context: context,
builder: (context) => yourWidget,
enableDrag: false,
);
Set enableDrag
property of BottomSheet
to false
its true
by default
BottomSheet(
enableDrag: false,
builder: //builder
),
Refer here for more info on BottomSheet