adding missing const
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,28 +23,28 @@ Widget getFirstPage() {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasData) {
|
||||
List<Trip> trips = snapshot.data!;
|
||||
if (trips.length > 0) {
|
||||
if (trips.isNotEmpty) {
|
||||
return TripPage(trip: trips[0]);
|
||||
} else {
|
||||
return NoTripsPage();
|
||||
return const NoTripsPage();
|
||||
}
|
||||
} else {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
} else {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return OnboardingPage();
|
||||
return const OnboardingPage();
|
||||
}
|
||||
} else {
|
||||
return OnboardingPage();
|
||||
return const OnboardingPage();
|
||||
}
|
||||
} else {
|
||||
return OnboardingPage();
|
||||
return const OnboardingPage();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user