FirebaseAuthService class
AuthService on Firebase Auth. With anonymousWhenSignedOut (the SDK reads published data as an anonymous user), signing out or deleting the account signs in anonymously again; anonymous users read as signed out.
A guest session (signInAsGuest) is the anonymous user, marked as a guest by its uid in storage (so it survives reloads, as the anonymous user itself does).
- Implemented types
Constructors
- FirebaseAuthService(FirebaseAuth auth, {bool anonymousWhenSignedOut = true, bool? web, LocalStorage? storage})
Properties
- anonymousWhenSignedOut → bool
-
final
- auth → FirebaseAuth
-
final
- currentUser → AppUser?
-
The signed-in user (maybe anonymous), or null.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → LocalStorage?
-
Where the guest session's uid is kept (memory when null).
final
-
userChanges
→ Stream<
AppUser?> -
The user, on every sign-in, sign-out and profile change.
no setteroverride
Methods
-
deleteAccount(
) → Future< void> -
Deletes the signed-in user's account.
override
-
isSignInLink(
String link) → bool -
Whether
linkis a sign-in link.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reauthenticate(
String password) → Future< void> -
Confirms the signed-in user's
password(a recent sign-in, which changing the password and deleting the account need). Fails withwrong-passwordwhen it isn't theirs.override -
sendEmailVerification(
) → Future< void> -
override
-
sendPasswordResetEmail(
String email) → Future< void> -
override
-
sendSignInLink(
String email, {required String continueUrl}) → Future< void> -
Emails
emaila sign-in link back tocontinueUrl.override -
signIn(
{required String email, required String password}) → Future< AppUser> -
override
-
signInAsGuest(
) → Future< AppUser> -
Starts a guest session: an anonymous user marked AppUser.isGuest
(the one already signed in anonymously, when there is one). A
signUp during it keeps its uid.
override
-
signInWithLink(
String email, String link) → Future< AppUser> -
Signs in with a sign-in
linksent toemail.override -
signInWithProvider(
AuthProviderKind provider) → Future< AppUser> -
override
-
signOut(
) → Future< void> -
Signs out (an implementation that reads published data as an
anonymous user signs in anonymously again).
override
-
signUp(
{required String email, required String password, String displayName = ''}) → Future< AppUser> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updatePassword(
String password) → Future< void> -
override
-
updateProfile(
{String? displayName, String? photoUrl}) → Future< void> -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited