Skip to content

Instantly share code, notes, and snippets.

@webianks
Last active August 14, 2019 08:39
Show Gist options
  • Save webianks/15de1bb961f9cbdd11dedd72b1fdf1e7 to your computer and use it in GitHub Desktop.
Save webianks/15de1bb961f9cbdd11dedd72b1fdf1e7 to your computer and use it in GitHub Desktop.
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return new CupertinoAlertDialog(
title: new Text('Data not saved?'),
content: new Text(
'Data will be lost. Are you sure you want to exit?'),
actions: <Widget>[
new CupertinoButton(
onPressed: () => Navigator.of(context).pop(false),
child: new Text('No'),
),
new CupertinoButton(
onPressed: () => Navigator.of(context).pop(true),
child: new Text('Yes'),
),
],
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment