Unfortunately, you cannot change the enableDrag or isDismissible property of a showModalBottomSheet once it is already constructed. This is because these properties are set when the widget is built and cannot be changed dynamically.
One solution would be to create a new instance of the showModalBottomSheet widget with the desired properties when the Firebase response is received. You can do this by wrapping the showModalBottomSheet in a function and calling that function with the appropriate parameters when needed.
Here's an example:
void _showModal(BuildContext context, {bool enableDrag = true, bool isDismissible = true}) {
showModalBottomSheet(
context: context,
enableDrag: enableDrag,
isDismissible: isDismissible,
builder: (BuildContext context) {
return Container(
child: Text('Modal content'),
);
},
);
}
Then, you can call this function with the default values when you want to show the modal:
_showModal(context);
And call it again with the updated values when the Firebase response is received:
_showModal(context, enableDrag: false, isDismissible: false);
This will create a new instance of the showModalBottomSheet widget with the updated properties and display it on top of the previous one.