Beginning to use different contexts
Some checks failed
Build and push docker image / Build (pull_request) Failing after 2m49s
Build and release APK / Build APK (pull_request) Successful in 5m48s
Build web / Build Web (pull_request) Successful in 1m32s

This commit is contained in:
2024-06-03 13:51:01 +02:00
parent ebaec40d6b
commit d5e0b7d51a
14 changed files with 271 additions and 42 deletions

View File

@@ -38,6 +38,17 @@ class Landmark {
};
}
Map<String, dynamic> toJson() {
return {
'name': name,
'location': location,
'type': type.name,
// 'description': description,
// 'duration': duration.inMinutes,
// 'visited': visited
};
}
}

View File

@@ -0,0 +1,25 @@
// Represents a collection of landmarks that represent a journey
// Different instances of a Trip can be saved and loaded by the user
import 'package:fast_network_navigation/structs/landmark.dart';
class Trip {
final String uuid;
final String cityName;
final List<Landmark> landmarks;
Trip({required this.uuid, required this.cityName, required this.landmarks});
factory Trip.fromJson(Map<String, dynamic> json) {
List<Landmark> landmarks = [];
for (var landmark in json['landmarks']) {
landmarks.add(Landmark.fromJson(landmark));
}
return Trip(
uuid: json['uuid'],
cityName: json['cityName'],
landmarks: landmarks,
);
}
}