signInWithEmailAndPassword method

  1. @override
Future<User?> signInWithEmailAndPassword({
  1. required String email,
  2. required String password,
  3. Function? onSuccessOption,
  4. Function? userNotFound,
  5. Function? wrongPassword,
  6. Function? catchErrorOption,
})
override

Implementation

@override
Future<User?> signInWithEmailAndPassword({
  required String email,
  required String password,
  Function? onSuccessOption,
  Function? userNotFound,
  Function? wrongPassword,
  Function? catchErrorOption,
}) async {
  try {
    UserCredential userCredential = await auth.signInWithEmailAndPassword(
        email: email, password: password);
    onSuccessOption;
    return userCredential.user;
  } on FirebaseAuthException catch (e) {
    firebaseAuthOnCacthError(
      e,
      userNotFound: userNotFound,
      wrongPassword: wrongPassword,
    );
  } catch (e) {
    catchOnError(' Sign In Email was Error: $e',
        catchErrorOption: catchErrorOption);
  }
  return null;
}