account for changed itineraries once landmarks are marked as done or deleted
This commit is contained in:
@@ -75,8 +75,16 @@ class Trip with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void removeLandmark(Landmark landmark) {
|
||||
void removeLandmark (Landmark landmark) async {
|
||||
Landmark? previous = landmark.previous;
|
||||
Landmark? next = landmark.next;
|
||||
landmarks.remove(landmark);
|
||||
// removing the landmark means we need to recompute the time between the two adjoined landmarks
|
||||
if (previous != null && next != null) {
|
||||
// previous.next = next happens automatically since we are using a LinkedList
|
||||
previous.tripTime = null;
|
||||
// TODO
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user