showAlertDialog static method
Implementation
static showAlertDialog(BuildContext context,String title ,String content)
{
// Create button
Widget YesButton = TextButton(
child: const Text("Ok"),
onPressed: () {
Navigator.of(context,rootNavigator: true).pop();
},
);
AlertDialog alert = AlertDialog(
title: Text(title),
content: Text(content),
actions: [
YesButton,
],
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}