I have AlertDialog
in static method, in that I wants to get callback when user clicks on OK
button.
I tried using typedef
but can't understand.
Below is My Code:
class DialogUtils{
static void displayDialogOKCallBack(BuildContext context, String title,
String message)
{
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text(title, style: normalPrimaryStyle,),
content: new Text(message),
actions: <Widget>[
new FlatButton(
child: new Text(LocaleUtils.getString(context, "ok"), style: normalPrimaryStyle,),
onPressed: () {
Navigator.of(context).pop();
// HERE I WANTS TO ADD CALLBACK
},
),
],
);
},
);
}
}