📜  flutter showdialog 禁用后退按钮 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:12.560000             🧑  作者: Mango

代码示例1
showDialog(
  context: context,
  barrierDismissible: false,
  builder: (BuildContext context) {
    return WillPopScope(
      onWillPop: () async => false,
      child: AlertDialog(
        title: Text('Title'),
        content: Text('This is Demo'),
        actions: [
          FlatButton(
            onPressed: () => Navigator.pop(context),
            child: Text('Go Back'),
          ),
        ],
      ),
    );
  },
);