FirebaseAccount class
A firebase account, representing the identity of a logged in user.
Provides account credentials and operations to get more data about the user or to modify the remote account. Also provide automatic refreshing of the idToken.
To create an account, either load one from an existing refresh token via FirebaseAccount.restore(), or use one of the various login methods of the FirebaseAuth class.
Constructors
- FirebaseAccount.apiCreate(RestApi api, SignInResponse signInResponse, {bool autoRefresh = true, String? locale})
- Creates a new account from a successfuly sign in response and a RestApi.
- FirebaseAccount.create(Client client, String apiKey, SignInResponse signInResponse, {bool autoRefresh = true, String? locale})
- Creates a new account from a successfuly sign in response.
Properties
- api → RestApi
-
The internally used RestApi instance.
final
- autoRefresh ↔ bool
-
Specifies if the the account should automatically refresh the idToken.
getter/setter pair
- expiresAt → DateTime
-
The point in time when the current idToken expires.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- idToken → String
-
The id token of the logged in user.
no setter
-
idTokenStream
→ Stream<
String> -
A broadcast stream of idTokens.
no setter
- locale ↔ String?
-
The default locale to be used for E-Mails sent by Firebase.
getter/setter pair
- localId → String
-
The local id (account-id) of the logged in user.
no setter
- refreshToken → String
-
The refresh token token of the logged in user.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
confirmEmail(
String oobCode) → Future< void> - Verifies the users email by completing the process.
-
delete(
) → Future< void> - Delete the account
-
dispose(
) → Future< void> - Disposes the account
-
getDetails(
) → Future< UserData?> - Fetches the user profile details of the account.
-
linkEmail(
String email, String password, {bool autoVerify = true, String? locale}) → Future< bool> - Links a new email address to this account.
-
linkIdp(
IdpProvider provider, Uri requestUri) → Future< void> - Links a new IDP-Account to this account.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → Future< String> - Refreshes the accounts idToken and returns the new token.
-
requestEmailConfirmation(
{String? locale}) → Future - Sends a verification email at the users email.
-
toString(
) → String -
A string representation of this object.
inherited
-
unlinkProviders(
List< String> providers) → Future<void> - Unlinks all specified providers from the account.
-
updateEmail(
String newEmail, {String? locale}) → Future< void> - Updates the users email address.
-
updatePassword(
String newPassword) → Future< void> - Updates the users login password.
-
updateProfile(
{ProfileUpdate< String> ? displayName, ProfileUpdate<Uri> ? photoUrl}) → Future<void> - Updates certain aspects of the users profile.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
apiRestore(
RestApi api, String refreshToken, {bool autoRefresh = true, String? locale}) → Future< FirebaseAccount> - Restores an account by using a refresh token to log the user in again.
-
restore(
Client client, String apiKey, String refreshToken, {bool autoRefresh = true, String? locale}) → Future< FirebaseAccount> - Restores an account by using a refresh token to log the user in again.