reworked page layout inheritence
This commit is contained in:
@@ -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,
|
||||
|
@@ -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',
|
||||
|
Reference in New Issue
Block a user