diff --git a/lib/src/screens/event.dart b/lib/src/screens/event.dart index 9ba2300..1c290b8 100644 --- a/lib/src/screens/event.dart +++ b/lib/src/screens/event.dart @@ -481,14 +481,31 @@ class EditEventFightDialog extends HookConsumerWidget { actions: [ TextButton( onPressed: () async { - Navigator.of(context).pop(); - ref.read(eventRepositoryProvider.future).then( - (value) => value.deleteFight(fight.id).then( - (value) { - fightsRefresher(); - }, - ), - ); + final delete = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text("Delete Fight?"), + content: const Text( + "Do you really want to delete this fight?"), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: const Text("No")), + TextButton( + onPressed: () => Navigator.of(context).pop(true), + child: const Text("Yes", + style: TextStyle(color: Colors.red))), + ], + )); + if (delete) { + ref.read(eventRepositoryProvider.future).then( + (value) => value.deleteFight(fight.id).then( + (value) { + fightsRefresher(); + }, + ), + ); + } }, child: const Text("Delete")), TextButton(