Error provider
This commit is contained in:
@@ -8,10 +8,17 @@ class GymLinkProvider with ChangeNotifier {
|
||||
bool get blackTheme => _blackTheme;
|
||||
ThemeData _theme = myTheme;
|
||||
ThemeData get theme => _theme;
|
||||
void Function() _onError = () => {};
|
||||
|
||||
void Function() get onError => _onError;
|
||||
|
||||
void onTokenReceived(String token) {
|
||||
if (token == 'token123') {
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
} else {
|
||||
_isLoading = true;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +32,8 @@ class GymLinkProvider with ChangeNotifier {
|
||||
_theme = theme;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setOnError(void Function() onError) {
|
||||
_onError = onError;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user