Error provider

This commit is contained in:
2024-05-17 16:11:05 +03:00
parent c54176212a
commit 986a9d9bd5
7 changed files with 238 additions and 204 deletions

View File

@@ -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;
}
}