From 4a408db1cdfcf5e605078cfa5a7cd04045bc50b8 Mon Sep 17 00:00:00 2001 From: Steellow Date: Tue, 30 Jun 2020 20:37:11 +0300 Subject: [PATCH] added confirm dialog when deleting logs --- .../history/widgets/history_list_view.dart | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/screens/history/widgets/history_list_view.dart b/lib/screens/history/widgets/history_list_view.dart index dcd17bd..b716b26 100644 --- a/lib/screens/history/widgets/history_list_view.dart +++ b/lib/screens/history/widgets/history_list_view.dart @@ -117,26 +117,28 @@ class _HistoryListViewState extends State { }); } else { Get.dialog( - AlertDialog( - title: Text("Are you sure?"), - actions: [ - FlatButton( - onPressed: () { - Get.back(); - }, - child: Text("Cancel"), - ), - FlatButton( - onPressed: () { - setState(() { - logBox.deleteAt(hiveIndex); - TripComputer.recalculateEverything(); // recalculates prefs all over again if deleting log - }); - Get.back(); - }, - child: Text("Delete"), - ), - ], + ThemeConsumer( + child: AlertDialog( + title: Text("Are you sure?"), + actions: [ + FlatButton( + onPressed: () { + Get.back(); + }, + child: Text("Cancel"), + ), + FlatButton( + onPressed: () { + setState(() { + logBox.deleteAt(hiveIndex); + TripComputer.recalculateEverything(); // recalculates prefs all over again if deleting log + }); + Get.back(); + }, + child: Text("Delete"), + ), + ], + ), ), ); }