Add: get token from api
This commit is contained in:
@@ -6,6 +6,8 @@ class GymLinkProvider with ChangeNotifier {
|
||||
bool get isLoading => _isLoading;
|
||||
bool _blackTheme = false;
|
||||
bool get blackTheme => _blackTheme;
|
||||
String _token = '';
|
||||
String get token => _token;
|
||||
ThemeData _theme = myTheme;
|
||||
ThemeData get theme => _theme;
|
||||
void Function() _onError = () => {};
|
||||
@@ -13,13 +15,16 @@ class GymLinkProvider with ChangeNotifier {
|
||||
void Function() get onError => _onError;
|
||||
|
||||
void onTokenReceived(String token) {
|
||||
if (token == 'token123') {
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
} else {
|
||||
_isLoading = true;
|
||||
notifyListeners();
|
||||
}
|
||||
_token = token;
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
// if (token == 'token123') {
|
||||
// _isLoading = false;
|
||||
// notifyListeners();
|
||||
// } else {
|
||||
// _isLoading = true;
|
||||
// notifyListeners();
|
||||
// }
|
||||
}
|
||||
|
||||
void changeTheme(int color) {
|
||||
|
||||
Reference in New Issue
Block a user