1
0

Fixes for Fixes for the final Fixes

Dieser Commit ist enthalten in:
Chaoscaot 2022-12-26 21:56:40 +01:00
Ursprung cff370fa15
Commit 2c44eea71c

Datei anzeigen

@ -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(