FirebaseLoginService class

A service to handle authentication with Firebase. Takes an instance of FirebaseAuth and an optional LoginServiceTranslations

Constructors

FirebaseLoginService({required FirebaseAuth auth, LoginServiceTranslations translationsService = const LoginServiceTranslations.empty()})

Properties

auth FirebaseAuth
The FirebaseAuth instance to use for authentication.
final
hashCode int
The hash code for this object.
no setterinherited
loginError ↔ LoginResponse?
The error response from the last login attempt.
getter/setter pair
requestPasswordError ↔ RequestPasswordResponse?
The error response from the last password reset request.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
translationsService → LoginServiceTranslations
The translations service to use for error messages.
final

Methods

getLoggedInUser() Future<User?>
Get the currently logged in user.
loginWithEmailAndPassword(String email, String password, BuildContext context, {dynamic onMFA(dynamic resolver)?}) Future<LoginResponse>
Log in with email and password. Returns a LoginResponse with the user object if the login was successful. If the login was not successful, the response will contain an Error object with the error title and message.
logout(BuildContext context) Future<bool>
Log out the currently logged in user. Returns true if the logout was successful, false if it was not.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestChangePassword(String email, BuildContext context) Future<RequestPasswordResponse>
Request a password reset for the given email. Returns a RequestPasswordResponse with a boolean indicating whether the request was successful. If the request was not successful, the response will contain an Error object with the error title and message.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited