AuthenticationRepository class
Repository which manages user authentication.
Constructors
- AuthenticationRepository({CacheClient? cache, FirebaseAuth? firebaseAuth, GoogleSignIn? googleSignIn, FacebookAuth? facebookAuth})
- Repository which manages user authentication.
Properties
- currentUser → AuthUser
-
Returns the current cached user.
Defaults to AuthUser.empty if there is no cached user.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isWeb ↔ bool
-
Whether or not the current environment is web
Should only be overriden for testing purposes. Otherwise,
defaults to kIsWeb
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tokenRefresh
→ Stream<
AuthUser> -
Stream of
AuthUser
which will emit the current user when the authentication state changes. This stream will also emit when the user is signed out.no setter -
user
→ Stream<
AuthUser> -
Stream of
AuthUser
which will emit the current user when the authentication state changes.no setter -
userChanges
→ Stream<
AuthUser> -
Stream of
AuthUser
which will emit the current user when the authentication state changes. This stream will also emit when the user is signed out.no setter - verificationId ↔ String
-
Store verification id
getter/setter pair
Methods
-
confirmPhoneCode(
String code) → Future< void> - Confirme phone with code
-
confirmPhoneCodeWeb(
String verificationCode) → Future< void> - Confirm phone code on Web platform
-
linkWithProvider(
SocialProvider provider) → Future< void> - Link provider to user
-
logInWithApple(
) → Future< AuthUser?> - Starts the Sign In with Apple Flow.
-
logInWithAppleWeb(
) → Future< void> - Starts the Sign In with Apple Flow.
-
logInWithEmailAndPassword(
{required String email, required String password}) → Future< void> -
Signs in with the provided
email
andpassword
. -
logInWithFacebook(
) → Future< AuthUser?> - Starts the Sign In with Facebook Flow.
-
logInWithFacebookWeb(
) → Future< void> - Starts the Sign In with Facebook Flow.
-
logInWithGoogle(
) → Future< AuthUser?> - Starts the Sign In with Google Flow.
-
logInWithPhone(
String phoneNumber, void onCodeSent()) → Future< void> - Starts the Sign In with Phone Flow.
-
logInWithPhoneWeb(
String phoneNumber) → Future< void> - Starts the Sign In with Phone Flow on Web platform
-
logOut(
) → Future< void> - Signs out the current user which will emit AuthUser.empty from the user Stream.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendEmailVerification(
) → Future< void> - Send email verification
-
sendResetPassword(
{required String email}) → Future< void> -
signInAnonymously(
) → Future< AuthUser?> - Anom sign in
-
signUp(
{required String email, required String password}) → Future< String> -
Creates a new user with the provided
email
andpassword
. -
toString(
) → String -
A string representation of this object.
inherited
-
unlinkProvider(
SocialProvider provider) → Future< void> - Unlink provider from user
-
updatePhoneNumber(
String code) → Future< void> - Update phone number
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- userCacheKey → const String
- User cache key. Should only be used for testing purposes.