better errorhandling, slimmed down optimizer
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m40s
Build and release APK / Build APK (pull_request) Successful in 5m26s

This commit is contained in:
2024-08-05 15:27:25 +02:00
parent 71d9554d97
commit 89511f39cb
9 changed files with 138 additions and 70 deletions

View File

@@ -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');