adding missing const

This commit is contained in:
2025-10-20 17:08:10 +02:00
parent 71c7325370
commit 0070e57aec
36 changed files with 298 additions and 210 deletions

View File

@@ -21,7 +21,7 @@ Dio dio = Dio(
validateStatus: (status) => status! <= 500,
receiveDataWhenStatusError: true,
contentType: Headers.jsonContentType,
responseType: ResponseType.json,
responseType: ResponseType.json,
),
);
@@ -32,7 +32,7 @@ fetchTrip(
) async {
Map<String, dynamic> data = {
"preferences": preferences.toJson(),
"start": trip.landmarks!.first.location,
"start": trip.landmarks.first.location,
};
String dataString = jsonEncode(data);
log(dataString);
@@ -45,7 +45,7 @@ fetchTrip(
);
} catch (e) {
trip.updateUUID("error");
// Format the error message to be more user friendly
String errorDescription;
if (e is DioException) {
@@ -93,7 +93,7 @@ fetchTrip(
// Actualy no need to throw an exception, we can just log the error and let the user retry
// throw Exception(errorDetail);
} else {
// if the response data is not json, throw an error
if (response.data is! Map<String, dynamic>) {
log("${response.data.runtimeType}");
@@ -142,7 +142,7 @@ patchLandmarkImage(Landmark landmark) async {
// the image is a google photos link, we should get the image behind the link
String? newUrl = await getImageUrlFromGooglePhotos(landmark.imageURL!);
// also set the new url if it is null
landmark.imageURL = newUrl;
landmark.imageURL = newUrl;
}
}