是否有可能阻止 ModalBottomSheet
对外部触摸隐藏?就像在 showDialog()
中一样,我们可以使用 barrierDismissible
property to prevent dialog from closing on outside touch
最佳答案
你可以像这样使用 isDismissible: false
和 enableDrag: false
showModalBottomSheet(
isDismissible: false,
enableDrag: false,
builder: (context) {
return Container(
height: 100.0
)
}
);
关于flutter - 防止从外部触摸隐藏 showModalBottomSheet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57606605/