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

@@ -18,7 +18,7 @@ class Trip with ChangeNotifier {
String? errorDescription;
Future<String> get cityName async {
List<double>? location = landmarks.firstOrNull?.location;
List<double>? location = landmarks.firstOrNull?.location;
if (GeocodingPlatform.instance == null) {
return '$location';
} else if (location == null) {
@@ -48,7 +48,7 @@ class Trip with ChangeNotifier {
LinkedList<Landmark>? landmarks
// a trip can be created with no landmarks, but the list should be initialized anyway
}) : landmarks = landmarks ?? LinkedList<Landmark>();
factory Trip.fromJson(Map<String, dynamic> json) {
Trip trip = Trip(
@@ -82,11 +82,11 @@ class Trip with ChangeNotifier {
// removing the landmark means we need to recompute the time between the two adjoined landmarks
if (previous != null && next != null) {
// previous.next = next happens automatically since we are using a LinkedList
this.totalTime -= previous.tripTime ?? Duration.zero;
totalTime -= previous.tripTime ?? Duration.zero;
previous.tripTime = null;
// TODO
}
this.totalTime -= landmark.tripTime ?? Duration.zero;
totalTime -= landmark.tripTime ?? Duration.zero;
notifyListeners();
}