signInWithEmailAndPassword method

  1. @override
Future<void> signInWithEmailAndPassword({
  1. required String email,
  2. required String password,
})
override

Implementation

@override
Future<void> signInWithEmailAndPassword({
  required String email,
  required String password,
}) async {
  await Future.delayed(const Duration(milliseconds: 500));

  if (_mockUsers.containsKey(email)) {
    if (_mockUsers[email] == password) {
      _updateState(AuthState.authenticated({'email': email, 'uid': 'mock-uid-123'}));
      return;
    } else {
      throw const InvalidCredentialsException(message: 'Wrong password provided for that user.');
    }
  } else {
    throw const UserNotFoundException(message: 'No user found for that email.');
  }
}