I use showModalBottomSheet
to render a bottom sheet with buttons (StatefulWidgetWithButtons
). Once a button is pressed the state of the sheet changes and it gets re-rendered with different content.
I would like that depending on a certain state the sheet becomes not dismissable. I can achieve this using
showModalBottomSheet(
isDismissable: false
builder: (context) => StatefulWidgetWithButtons()
)
however what I want to achieve is that depending on a certain button pressed within StatefulWidgetWithButtons
the isDismissable
property changes to true
(or false
).
I don't know how to achieve this since I know I can change the StatefulWidgetWithButtons
but that won't rebuild the bottom sheet.
I also don't want to close and show again the bottom sheet but change its dismissable behaviour while it is rendered