createUserWithEmailAndPassword method

  1. @override
Future<UserCredentialPlatform> createUserWithEmailAndPassword(
  1. String email,
  2. String password
)

Tries to create a new user account with the given email address and password.

A FirebaseAuthException maybe thrown with the following error code:

  • email-already-in-use:
  • Thrown if there already exists an account with the given email address.
  • invalid-email:
  • Thrown if the email address is not valid.
  • operation-not-allowed:
  • Thrown if email/password accounts are not enabled. Enable email/password accounts in the Firebase Console, under the Auth tab.
  • weak-password:
  • Thrown if the password is not strong enough.

Implementation

@override
Future<UserCredentialPlatform> createUserWithEmailAndPassword(
    String email, String password) async {
  final userCredential = await guardAuthExceptions(
    () => delegate.createUserWithEmailAndPassword(email, password),
  );

  return UserCredentialWeb(
    this,
    userCredential,
    _webAuth,
  );
}