So I have an showModalBottonSheet, and I want that by default it can close with enableDrag or isDismissible as well, but, when the app is waiting Firebase to respond, after the user search for an object, I want to set enableDrag and isDismissible to false
I already tried setState and even GetX controller as well, I can't set this two to false and change the state after the showModalBottomSheet is constructed, it only works if the modal closes and open again
@override
Widget build(BuildContext context) {
return FloatingActionButton(
onPressed: () async {
showModalBottomSheet(
backgroundColor: Styles.bgColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(25),
),
),
isScrollControlled: true,
context: context,
builder: (context) {
return StatefulBuilder(builder: (context, setState) {
return FractionallySizedBox(
heightFactor: 0.6,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Form(
key: formKey,
child: modeToAdd
? buildAddManually(setState)
: buildAddBySearch(setState),
),
),
);
});
},
);
},
child: const Icon(Icons.add),
);
}