reworked page layout inheritence

This commit is contained in:
2025-02-15 19:36:41 +01:00
parent 8f6dfd404d
commit 56c55883ea
21 changed files with 278 additions and 278 deletions

View File

@@ -70,10 +70,10 @@ final class Landmark extends LinkedListEntry<Landmark>{
final websiteURL = json['website_url'] as String?;
final imageURL = json['image_url'] as String?;
final description = json['description'] as String?;
var duration = Duration(minutes: json['duration'] ?? 0) as Duration?;
final visited = json['visited'] ?? false as bool;
var duration = Duration(minutes: json['duration']);
final visited = json['visited'] ?? false;
var tripTime = Duration(minutes: json['time_to_reach_next'] ?? 0) as Duration?;
return Landmark(
uuid: uuid,
name: name,

View File

@@ -29,6 +29,18 @@ class Trip with ChangeNotifier {
}
}
Future<int> landmarkPosition (Landmark landmark) async {
int i = 0;
for (Landmark l in landmarks) {
if (l.uuid == landmark.uuid) {
return i;
} else if (l.type != typeStart && l.type != typeFinish) {
i++;
}
}
return -1;
}
Trip({
this.uuid = 'pending',