alertDialog method
Implementation
void alertDialog(BuildContext context) {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Discard draft ?"),
actions: <Widget>[
TextButton(
child: const Text('CANCEL'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('DISCARD'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}