flutter linting
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user