createUserWithEmailAndPassword method

  1. @override
Future<User?> createUserWithEmailAndPassword({
  1. required String email,
  2. required String password,
  3. Function? createSuccessOption,
  4. Function? weakPasswordOption,
  5. Function? alreadyExistOption,
  6. Function? catchErrorOption,
})
override

Implementation

@override
Future<User?> createUserWithEmailAndPassword({
  required String email,
  required String password,
  Function? createSuccessOption,
  Function? weakPasswordOption,
  Function? alreadyExistOption,
  Function? catchErrorOption,
}) async {
  try {
    final credential = await auth.createUserWithEmailAndPassword(
        email: email, password: password);
    createSuccessOption;
    return credential.user;
  } on FirebaseAuthException catch (error) {
    firebaseAuthOnCacthError(
      error,
      weakPasswordOption: weakPasswordOption,
      alreadyEmailExistOption: alreadyExistOption,
    );
  } catch (e) {
    catchOnError(e, catchErrorOption: catchErrorOption);
  }
  return null;
}