【发布时间】:2020-05-02 10:39:44
【问题描述】:
我正在使用showDialog函数构建一个对话框,但是我需要避免当用户按下返回按钮时,对话框没有关闭,这是我的代码:
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
// return object of type Dialog
return AlertDialog(
title: new Text("Hello"),
content: new SingleChildScrollView(
child: Container(),
actions: <Widget>[
// usually buttons at the bottom of the dialog
new FlatButton(
child: new Text("Close"),
onPressed: () {
},
),
],
);
},
);
如何让它不关闭?
【问题讨论】:
标签: flutter