


# signInWithEmailAndPassword 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)> signInWithEmailAndPassword
({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>Signs in with the provided <code>email</code> and <code>password</code>.</p>
<p>Throws a SignInWithEmailAndPasswordFailureInterface if
an exception occurs.</p>



## Implementation

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

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







