account for changed itineraries once landmarks are marked as done or deleted

This commit is contained in:
2025-02-16 12:41:06 +01:00
parent 56c55883ea
commit 6f2f86f936
6 changed files with 135 additions and 110 deletions

View File

@@ -22,6 +22,14 @@ class _StepBetweenLandmarksState extends State<StepBetweenLandmarks> {
@override
Widget build(BuildContext context) {
int? time = widget.current.tripTime?.inMinutes;
// since landmarks might have been marked as visited, the next landmark might not be the immediate next in the list
// => the precomputed trip time is not valid anymore
if (widget.current.next != widget.next) {
time = null;
}
// round 0 travel time to 1 minute
if (time != null && time < 1) {
time = 1;
}