Flutter 打开showModalBottomSheet时禁用android back

Flutter 打开showModalBottomSheet时禁用android back,flutter,Flutter,showModalBottomSheet中的小部件是一个文本字段,用户必须填写正确的值才能继续下一个功能,我知道有一个名为isDismissible的就绪参数,但它只从录制背景中禁用,不会将android还原 return showModalBottomSheet( context: context, builder: (BuildContext context) { ... } } 您可以使用WillPopScope 例如: WillPopScope(

showModalBottomSheet中的小部件是一个文本字段,用户必须填写正确的值才能继续下一个功能,我知道有一个名为
isDismissible
的就绪参数,但它只从录制背景中禁用,不会将android还原

return showModalBottomSheet(
    context: context,
    builder: (BuildContext context) {
        ...
    }
}

您可以使用
WillPopScope

例如:

WillPopScope(
  onWillPop: () async => false,
)