fixed logout at refresh failed

This commit is contained in:
amirrezaghabeli
2026-04-16 16:36:55 +03:30
parent 41bba5d32c
commit cc0032b21d
12 changed files with 475 additions and 344 deletions
+17 -3
View File
@@ -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 {