Created
January 5, 2022 20:07
-
-
Save jtmuller5/033195b7e41d47bbaa574c99833c059e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool confirm = await showDialog<bool>( | |
context: context, | |
builder: (context) { | |
return AlertDialog( | |
title: const Text('Are you sure?'), | |
content: const Text('This action cannot be undone.'), | |
actions: [ | |
TextButton( | |
child: const Text('Cancel'), | |
onPressed: (){ | |
Navigator.pop(context,false); | |
}, | |
), | |
TextButton( | |
child:const Text('End'), | |
onPressed: (){ | |
Navigator.pop(context,true); | |
}, | |
) | |
], | |
); | |
},) ?? false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment