more pleasant progress handling, although somewhat flawed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user