account for changed itineraries once landmarks are marked as done or deleted
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:anyway/structs/landmark.dart';
|
||||
@@ -24,10 +26,16 @@ List<Widget> landmarksList(Trip trip, {required bool Function(Landmark) selector
|
||||
LandmarkCard(landmark, trip),
|
||||
);
|
||||
|
||||
if (!landmark.visited && landmark.next != null) {
|
||||
children.add(
|
||||
StepBetweenLandmarks(current: landmark, next: landmark.next!)
|
||||
);
|
||||
if (!landmark.visited) {
|
||||
Landmark? nextLandmark = landmark.next;
|
||||
while (nextLandmark != null && nextLandmark.visited) {
|
||||
nextLandmark = nextLandmark.next;
|
||||
}
|
||||
if (nextLandmark != null) {
|
||||
children.add(
|
||||
StepBetweenLandmarks(current: landmark, next: nextLandmark!)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user