Skip to content

Instantly share code, notes, and snippets.

@GravenilvecTV
Created February 11, 2024 08:53
Show Gist options
  • Save GravenilvecTV/d65be8865548252075287c5df0b14a9c to your computer and use it in GitHub Desktop.
Save GravenilvecTV/d65be8865548252075287c5df0b14a9c to your computer and use it in GitHub Desktop.
Future<void> _showMyDialog() async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('AlertDialog Title'),
content: const SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text('This is a demo alert dialog.'),
Text('Would you like to approve of this message?'),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('Approve'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment