some changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user