some changes

This commit is contained in:
amirrezaghabeli
2025-08-11 10:27:33 +03:30
parent 33f0a07d26
commit 86f0f03392
11 changed files with 66 additions and 76 deletions
+5 -3
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import '../core/utils/result.dart';
import '../data/models/user_model.dart';
import '../data/repositories/auth_repository.dart';
@@ -7,7 +8,7 @@ class AuthViewModel with ChangeNotifier {
final AuthRepository _authRepository;
AuthViewModel({required AuthRepository authRepository})
: _authRepository = authRepository {
: _authRepository = authRepository {
usernameController.addListener(_onTextChanged);
passwordController.addListener(_onTextChanged);
usernameFocus.addListener(_onTextChanged);
@@ -22,8 +23,7 @@ class AuthViewModel with ChangeNotifier {
bool _obscurePassword = true;
bool get obscurePassword => _obscurePassword;
bool get isLoginEnabled =>
usernameController.text.isNotEmpty &&
passwordController.text.isNotEmpty;
usernameController.text.isNotEmpty && passwordController.text.isNotEmpty;
// Auth state
bool _isLoading = false;
@@ -64,6 +64,8 @@ class AuthViewModel with ChangeNotifier {
_isLoading = false;
notifyListeners();
_errorMessage = null;
notifyListeners();
}
@override