mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add task
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
|
||||
class ViewModel extends ChangeNotifier{}
|
||||
|
||||
class ViewModel extends ChangeNotifier {}
|
||||
|
||||
class BaseViewModel extends ViewModel {
|
||||
PageState currentState = PageState.START;
|
||||
String? failReason;
|
||||
|
||||
void loading({bool notify = false}) {
|
||||
currentState = PageState.LOADING;
|
||||
@@ -21,8 +20,9 @@ class BaseViewModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
void failed({bool notify = false}) {
|
||||
void failed(String? reason, {bool notify = false}) {
|
||||
currentState = PageState.FAILED;
|
||||
failReason = reason;
|
||||
if (notify) {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user