我想更改我的 showModalBottomSheet 所处的状态。特别是在 true/false 之间更改 enableDrag 和 isDismissible 而不显示新模式或替换已呈现的模式。目前这有可能吗?
bool allowDismiss = false; // change this variable after render
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: allowDismiss,
enableDrag: allowDismiss,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.only(topLeft: Radius.circular(30), topRight: Radius.circular(30)),
),
builder: (context) => Container(height: 400),
)