more pleasant progress handling, although somewhat flawed

This commit is contained in:
2025-02-14 12:23:41 +01:00
parent aed407e2d0
commit 8f6dfd404d
8 changed files with 287 additions and 172 deletions

View File

@@ -52,6 +52,7 @@ class Trip with ChangeNotifier {
totalTime = json['total_time'];
notifyListeners();
}
void addLandmark(Landmark landmark) {
landmarks.add(landmark);
notifyListeners();
@@ -66,12 +67,16 @@ class Trip with ChangeNotifier {
landmarks.remove(landmark);
notifyListeners();
}
void updateError(String error) {
errorDescription = error;
notifyListeners();
}
void notifyUpdate(){
notifyListeners();
}
factory Trip.fromPrefs(SharedPreferences prefs, String uuid) {
String? content = prefs.getString('trip_$uuid');
Map<String, dynamic> json = jsonDecode(content!);
@@ -80,7 +85,6 @@ class Trip with ChangeNotifier {
log('Loading trip $uuid with first landmark $firstUUID');
LinkedList<Landmark> landmarks = readLandmarks(prefs, firstUUID);
trip.landmarks = landmarks;
// notifyListeners();
return trip;
}