createUserWithEmailAndPassword method
Future<User?>
createUserWithEmailAndPassword({
- required String email,
- required String password,
- Function? createSuccessOption,
- Function? weakPasswordOption,
- Function? alreadyExistOption,
- 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;
}