better errorhandling, slimmed down optimizer
This commit is contained in:
		| @@ -14,6 +14,7 @@ class Trip with ChangeNotifier { | ||||
|   int totalTime; | ||||
|   LinkedList<Landmark> landmarks; | ||||
|   // could be empty as well | ||||
|   String? errorDescription; | ||||
|  | ||||
|   Future<String> get cityName async { | ||||
|     List<double>? location = landmarks.firstOrNull?.location;  | ||||
| @@ -64,6 +65,11 @@ class Trip with ChangeNotifier { | ||||
|     landmarks.remove(landmark); | ||||
|     notifyListeners(); | ||||
|   } | ||||
|    | ||||
|   void updateError(String error) { | ||||
|     errorDescription = error; | ||||
|     notifyListeners(); | ||||
|   } | ||||
|  | ||||
|   factory Trip.fromPrefs(SharedPreferences prefs, String uuid) { | ||||
|     String? content = prefs.getString('trip_$uuid'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user