I have the following AlertDialog
.
showDialog(
context: context,
child: new AlertDialog(
title: const Text(\"Lo
You could wrap your AlertDialog in a async method to make the things clean.
_showAlertConfirmDelete() async {
// the response will store the .pop value (it can be any object you want)
var response = await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Warn'),
content: Text('Really wants to remove the record?'),
actions: [
FlatButton(
onPressed: () => Navigator.of(context)
.pop(false),
child: Text('No')),
FlatButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text('Yes'))
],
));
// do you want to do with the response.
print(response);
}