I have an AlertDialog with 1 button. Although I have set the barrierDismissable set to false, in iOS, the dialog can be still dismissed when the user clicked outside of the box.
I can accept either:
- When the user clicked outside the box is there a method to detect and call a specific function code?
- Prevent barrierDismissable issue in iOS
My code is as below:
Future<void> dialogNotifyUser(BuildContext context) {
return showDialog<void>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Title'),
content: Text('Body'),
actions: <Widget>[
FlatButton(
child: Text('Ok'),
onPressed: () {
Navigator.of(context).pop();
..... code
},
),
],
);
},
);
}
Is this a common issue, else I might use a 3rd party library or code an alert widget myself.