login method
Implementation
Future<bool> login(LoginCredentials credentials) async {
_setLoading(true);
_setError(null);
final result = await _authService.login(credentials);
return result.fold(
(user) {
_user = user;
_status = AuthStatus.authenticated;
_setLoading(false);
return true;
},
(error) {
_setError(error);
_setLoading(false);
return false;
},
);
}