У меня есть AlertDialog()
, что barrierDismissible
установлено на false
. Но все же, когда пользователь нажимает кнопку «Назад» на устройстве android, AlertDialog закрывается. Как я могу принудительно запретить пользователю закрывать AlertDialog ()?
Вот что я сделал до сих пор:
return showDialog<bool>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Title'),
content: Text('This is the alert dialog content'),
actions: <Widget>[
FlatButton(
child: Text('ok'),
onPressed: () {
Navigator.of(context).pop();
print('ok you win');
},
),
],
);
},
);