bare implementation of comuncation with the api
All checks were successful
Build and push docker image / Build (pull_request) Successful in 2m6s
Build and release APK / Build APK (pull_request) Successful in 4m32s

This commit is contained in:
2024-08-01 22:48:28 +02:00
parent 016622c7af
commit 5748630b99
5 changed files with 94 additions and 39 deletions

View File

@@ -11,6 +11,7 @@ class Trip {
final String uuid;
final String cityName;
// TODO: cityName should be inferred from coordinates of the Landmarks
final int totalTime;
final LinkedList<Landmark> landmarks;
// could be empty as well
@@ -19,15 +20,18 @@ class Trip {
required this.uuid,
required this.cityName,
required this.landmarks,
this.totalTime = 0
});
factory Trip.fromJson(Map<String, dynamic> json) {
return Trip(
Trip trip = Trip(
uuid: json['uuid'],
cityName: json['city_name'],
cityName: json['city_name'] ?? 'Not communicated',
landmarks: LinkedList()
);
return trip;
}
@@ -44,7 +48,7 @@ class Trip {
Map<String, dynamic> toJson() => {
'uuid': uuid,
'city_name': cityName,
'entry_uuid': landmarks.first?.uuid ?? ''
'first_landmark_uuid': landmarks.first.uuid
};