wait for progress animation to finish

This commit is contained in:
unknown
2021-10-03 15:04:47 +02:00
parent c418a61133
commit 428d6ff975
2 changed files with 7 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ class StatusProvider extends ChangeNotifier {
if (!_stack.contains(Status.syncing)) {
_stack.add(Status.syncing);
_progress = 0.0;
notifyListeners();
}
@@ -61,9 +62,12 @@ class StatusProvider extends ChangeNotifier {
}
if (_progress == 1.0) {
_stack.remove(Status.syncing);
_progress = 0.0;
notifyListeners();
// Wait for animation
Future.delayed(Duration(milliseconds: 250), () {
_stack.remove(Status.syncing);
notifyListeners();
});
} else if (progress != prev) notifyListeners();
}
}