


# signUpWithEmailAndPassword method




    *[<Null safety>](https://dart.dev/null-safety)*



- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)

[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> signUpWithEmailAndPassword
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password})

_<span class="feature">override</span>_



<p>Creates a new user with the provided <code>email</code> and <code>password</code>.</p>
<p>Returns the newly created user's unique identifier.</p>
<p>Throws a SignUpWithEmailAndPasswordFailureInterface if
an exception occurs.</p>



## Implementation

```dart
@override
Future<Account> signUpWithEmailAndPassword({
  required String email,
  required String password,
}) async {
  try {
    final userCredential = await _firebaseAuth.createUserWithEmailAndPassword(
      email: email,
      password: password,
    );

    return _addToStream(
      userCredential,
      (account) => SignedUpEvent(
        account: account,
      ),
    );
  } on FirebaseAuthException catch (e) {
    throw SignUpWithEmailAndPasswordFailureFirebase.fromCode(e.code);
  } catch (_) {
    throw SignUpWithEmailAndPasswordFailureFirebase();
  }
}
```







