CodePudding user response:
You can simply use flutter_dialogs
install in pubspec.yaml:
flutter_dialogs: ^2.1.1
Usage:
showPlatformDialog(
context: context,
builder: (context) => BasicDialogAlert(
title: Text("Are you sure?"),
content: Text("This Action will permanently remove the announcement"),
actions: <Widget>[
BasicDialogAction(
title: Text("Cancel"),
onPressed: () {
Navigator.pop(context);
},
),
BasicDialogAction(
title: Text("ok"),
onPressed: () {
//what to do after clicking ok
},
),
],
),
);