adding missing const
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user