Remy Moll d5e0b7d51a
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
Beginning to use different contexts
2024-06-03 13:51:01 +02:00

25 lines
682 B
Dart

// 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,
);
}
}