User class
User account.
Properties
- displayName → String
-
User's display name.
no setterinherited
- email → String
-
User's e-mail address.
no setterinherited
- emailVerified → bool
-
If the user's email address has been already verified.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAnonymous → bool
-
If the user is anonymous.
no setter
- jsObject → UserJsImpl
-
JS object.
finalinherited
- metadata → UserMetadata
-
Non-null additional metadata about the user.
no setter
- phoneNumber → String
-
The user's E.164 formatted phone number (if available).
no setterinherited
- photoURL → String
-
User's profile picture URL.
no setterinherited
-
providerData
→ List<
UserInfo< UserInfoJsImpl> > -
List of additional provider-specific information about the user.
no setter
- providerId → String
-
User's authentication provider ID.
no setterinherited
- refreshToken → String
-
Refresh token for the user account.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uid → String
-
User's unique ID.
no setterinherited
Methods
-
delete(
) → Future< void> - Deletes and signs out the user.
-
getIdToken(
[bool forceRefresh = false]) → Future< String> - Returns a JWT token used to identify the user to a Firebase service.
-
getIdTokenResult(
[bool? forceRefresh]) → Future< IdTokenResult> -
linkWithCredential(
AuthCredential credential) → Future< UserCredential> - Links the user account with the given credentials, and returns any available additional user information, such as user name.
-
linkWithPhoneNumber(
String phoneNumber, ApplicationVerifier< ApplicationVerifierJsImpl> applicationVerifier) → Future<ConfirmationResult> -
Links the user account with the given
phoneNumber
in E.164 format (e.g. +16505550101) andapplicationVerifier
. -
linkWithPopup(
AuthProvider< AuthProviderJsImpl> provider) → Future<UserCredential> -
Links the authenticated
provider
to the user account using a pop-up based OAuth flow. It returns theUserCredential
information if linking is successful. -
linkWithRedirect(
AuthProvider< AuthProviderJsImpl> provider) → Future<void> -
Links the authenticated
provider
to the user account using a full-page redirect flow. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reauthenticateWithCredential(
AuthCredential credential) → Future< UserCredential> - Re-authenticates a user using a fresh credential, and returns any available additional user information, such as user name.
-
reauthenticateWithPhoneNumber(
String phoneNumber, ApplicationVerifier< ApplicationVerifierJsImpl> applicationVerifier) → Future<ConfirmationResult> - Re-authenticates a user using a fresh credential. Use before operations such as updatePassword that require tokens from recent sign-in attempts.
-
reauthenticateWithPopup(
AuthProvider< AuthProviderJsImpl> provider) → Future<UserCredential> -
Reauthenticates a user with the specified provider using
a pop-up based OAuth flow.
It returns the
UserCredential
information if reauthentication is successful. -
reauthenticateWithRedirect(
AuthProvider< AuthProviderJsImpl> provider) → Future<void> -
Reauthenticates a user with the specified OAuth
provider
using a full-page redirect flow. -
reload(
) → Future< void> - If signed in, it refreshes the current user.
-
sendEmailVerification(
[ActionCodeSettings? actionCodeSettings]) → Future< void> - Sends an e-mail verification to a user.
-
toJson(
) → Map< String, dynamic> - Returns a JSON-serializable representation of this object.
-
toString(
) → String -
A string representation of this object.
override
-
unlink(
String providerId) → Future< User> -
Unlinks a provider with
providerId
from a user account. -
updateEmail(
String newEmail) → Future< void> -
Updates the user's e-mail address to
newEmail
. -
updatePassword(
String newPassword) → Future< void> -
Updates the user's password to
newPassword
. Requires the user to have recently signed in. If not, ask the user to authenticate again and then usereauthenticate()
. -
updatePhoneNumber(
OAuthCredential phoneCredential) → Future< void> - Updates the user's phone number.
-
updateProfile(
UserProfile profile) → Future< void> - Updates a user's profile data.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getInstance(
UserJsImpl? jsObject) → User? -
Creates a new User from a
jsObject
.