create static method
Future<void>
create(
- String title,
- String message,
- String okLabel,
- BuildContext context, {
- Function? callback,
Implementation
static Future<void> create(String title, String message, String okLabel, m.BuildContext context, {Function? callback}) async {
return m.showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (m.BuildContext context) {
return m.AlertDialog(
title: m.Text(title),
content: m.SingleChildScrollView(
child: m.ListBody(
children: <m.Widget>[
m.Text(message),
],
),
),
actions: <m.Widget>[
m.TextButton(
child: m.Text(okLabel),
onPressed: () {
m.Navigator.of(context).pop();
if(callback != null) {
callback();
}
},
),
],
);
},
);
}