fixed logout at refresh failed
This commit is contained in:
@@ -24,8 +24,8 @@ class AuthViewModel with ChangeNotifier {
|
||||
bool _obscurePassword = true;
|
||||
bool get obscurePassword => _obscurePassword;
|
||||
|
||||
bool get isLoginEnabled =>
|
||||
usernameController.text.isNotEmpty && passwordController.text.isNotEmpty;
|
||||
// bool get isLoginEnabled =>
|
||||
// usernameController.text.isNotEmpty && passwordController.text.isNotEmpty;
|
||||
|
||||
// Auth state
|
||||
bool _isLoading = false;
|
||||
@@ -59,8 +59,22 @@ class AuthViewModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
// void _onTextChanged() {
|
||||
// notifyListeners();
|
||||
// }
|
||||
bool _isLoginEnabled = false;
|
||||
|
||||
bool get isLoginEnabled => _isLoginEnabled;
|
||||
|
||||
void _onTextChanged() {
|
||||
notifyListeners();
|
||||
final newValue =
|
||||
usernameController.text.isNotEmpty &&
|
||||
passwordController.text.isNotEmpty;
|
||||
|
||||
if (newValue != _isLoginEnabled) {
|
||||
_isLoginEnabled = newValue;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> login() async {
|
||||
|
||||
Reference in New Issue
Block a user