delete function
Implementation
Future<bool> delete(context) async {
return await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: const Text(
'Want to delete ?',
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context, true);
},
child: const Text('Yes')),
TextButton(
onPressed: () {
Navigator.pop(context, false);
},
child: const Text('No')),
],
);
});
}