flutter linting

This commit is contained in:
unknown
2022-01-05 13:02:22 +01:00
parent 79f6ef4c50
commit 339dbea1ef
26 changed files with 226 additions and 143 deletions

View File

@@ -5,14 +5,14 @@ import 'package:http/http.dart' as http;
enum Status { network, maintenance, syncing }
class StatusProvider extends ChangeNotifier {
List<Status> _stack = [];
final List<Status> _stack = [];
double _progress = 0.0;
StatusProvider() {
_handleNetworkChanges();
}
Status? getStatus() => _stack.length > 0 ? _stack[0] : null;
Status? getStatus() => _stack.isNotEmpty ? _stack[0] : null;
// Status progress from 0.0 to 1.0
double get progress => _progress;
@@ -64,10 +64,12 @@ class StatusProvider extends ChangeNotifier {
if (_progress == 1.0) {
notifyListeners();
// Wait for animation
Future.delayed(Duration(milliseconds: 250), () {
Future.delayed(const Duration(milliseconds: 250), () {
_stack.remove(Status.syncing);
notifyListeners();
});
} else if (progress != prev) notifyListeners();
} else if (progress != prev) {
notifyListeners();
}
}
}