Skip to content

Commit

Permalink
added confirm dialog when deleting logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Steellow committed Jun 30, 2020
1 parent 136fdd8 commit 4a408db
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions lib/screens/history/widgets/history_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,28 @@ class _HistoryListViewState extends State<HistoryListView> {
});
} else {
Get.dialog(
AlertDialog(
title: Text("Are you sure?"),
actions: <Widget>[
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: <Widget>[
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"),
),
],
),
),
);
}
Expand Down

0 comments on commit 4a408db

Please sign in to comment.