Skip to content

Instantly share code, notes, and snippets.

@elleryq
Last active June 20, 2020 14:45
Show Gist options
  • Save elleryq/aac651d3bb41d2cd79f144cb9a99367d to your computer and use it in GitHub Desktop.
Save elleryq/aac651d3bb41d2cd79f144cb9a99367d to your computer and use it in GitHub Desktop.
Show confirm dialog in flutter
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(""),
content: Text("確定刪除?"),
actions: <Widget>[
FlatButton(
child: Text("取消"),
onPressed: () {
Navigator.of(context).pop();
},
),
FlatButton(
child: Text("刪除"),
onPressed: () {
model.deleteRoom(index);
},
),
],
);
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment