MockFirebaseAuth class
- Implemented types
-
- FirebasePluginPlatform
Constructors
Properties
- app ↔ FirebaseApp
-
The
FirebaseApp
for this current Auth instance.getter/setter pairoverride -
authForFakeFirestore
↔ Stream<
Map< String, dynamic> ?> -
Pass this to FakeFirestore's constructor so it can apply security rules
according to the signed in user. It builds the
auth
Map defined at https://firebase.google.com/docs/reference/rules/rules.firestore.Request#auth. The reason this is a Map<String, dynamic>?> instead of aUser
is because we don't want to make Fake Cloud Firestore depend on firebase_auth if possible.getter/setter pair -
authForFakeFirestoreStreamController
→ StreamController<
Map< String, dynamic> ?> -
final
- currentUser → User?
-
Returns the current
User
if they are currently signed-in, ornull
if not.no setteroverride - customAuthDomain ↔ String?
-
The current Auth instance's custom auth domain.
The auth domain used to handle redirects from OAuth provides, for example
"my-awesome-app.firebaseapp.com". By default, this is set to
null
and default auth domain is used.getter/setter pairinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- languageCode → String?
-
The current Auth instance's language code.
no setterinherited
- mockUser ← MockUser
-
no getter
-
onAuthStateChanged
→ Stream<
User> -
no setter
- pluginConstants → Map
-
Returns any plugin constants this plugin app instance has initialized.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stateChangedStream
↔ Stream<
User?> -
getter/setter pair
-
stateChangedStreamController
→ StreamController<
User?> -
final
- tenantId ↔ String?
-
The current Auth instance's tenant ID.
getter/setter pairinherited
-
userChangedStream
↔ Stream<
User?> -
getter/setter pair
-
userChangedStreamController
→ StreamController<
User?> -
final
Methods
-
applyActionCode(
String code) → Future< void> -
Applies a verification code sent to the user by email or other out-of-band
mechanism.
inherited
-
authStateChanges(
) → Stream< User?> -
Notifies about changes to the user's sign-in state (such as sign-in or
sign-out).
override
-
checkActionCode(
String code) → Future< ActionCodeInfo> -
Checks a verification code sent to the user by email or other out-of-band
mechanism.
inherited
-
confirmPasswordReset(
{required String code, required String newPassword}) → Future< void> -
Completes the password reset process, given a confirmation code and new
password.
override
-
createUserWithEmailAndPassword(
{required String email, required String password}) → Future< UserCredential> -
Tries to create a new user account with the given email address and
password.
override
-
fetchSignInMethodsForEmail(
String email) → Future< List< String> > -
Returns a list of sign-in methods that can be used to sign in a given
user (identified by its main email address).
override
-
getRedirectResult(
) → Future< UserCredential> -
Returns a UserCredential from the redirect-based sign-in flow.
inherited
-
idTokenChanges(
) → Stream< User?> -
Notifies about changes to the user's sign-in state (such as sign-in or
sign-out) and also token refresh events.
inherited
-
isSignInWithEmailLink(
String emailLink) → bool -
Checks if an incoming link is a sign-in with email link.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
override
-
revokeTokenWithAuthorizationCode(
String authorizationCode) → Future< void> -
Apple only. Users signed in with Apple provider can revoke their token using an authorization code.
Authorization code can be retrieved on the user credential i.e. userCredential.additionalUserInfo.authorizationCode
inherited
-
sendPasswordResetEmail(
{required String email, ActionCodeSettings? actionCodeSettings}) → Future< void> -
Sends a password reset email to the given email address.
override
-
sendSignInLinkToEmail(
{required String email, required ActionCodeSettings actionCodeSettings}) → Future< void> -
Sends a sign in with email link to provided email address.
override
-
setLanguageCode(
String? languageCode) → Future< void> -
When set to null, sets the user-facing language code to be the default app language.
inherited
-
setPersistence(
Persistence persistence) → Future< void> -
Changes the current type of persistence on the current Auth instance for
the currently saved Auth session and applies this type of persistence for
future sign-in requests, including sign-in with redirect requests.
inherited
-
setSettings(
{bool appVerificationDisabledForTesting = false, String? userAccessGroup, String? phoneNumber, String? smsCode, bool? forceRecaptchaFlow}) → Future< void> -
Updates the current instance with the provided settings.
inherited
-
signInAnonymously(
) → Future< UserCredential> -
Asynchronously creates and becomes an anonymous user.
override
-
signInWithAuthProvider(
AuthProvider provider) → Future< UserCredential> -
Signs in with an AuthProvider using native authentication flow. This is
deprecated in favor of
signInWithProvider()
.inherited -
signInWithCredential(
AuthCredential? credential) → Future< UserCredential> -
Asynchronously signs in to Firebase with the given 3rd-party credentials
(e.g. a Facebook login Access Token, a Google ID Token/Access Token pair,
etc.) and returns additional identity provider data.
override
-
signInWithCustomToken(
String token) → Future< UserCredential> -
Tries to sign in a user with a given custom token.
override
-
signInWithEmailAndPassword(
{required String email, required String password}) → Future< UserCredential> -
Attempts to sign in a user with the given email address and password.
override
-
signInWithEmailLink(
{required String email, required String emailLink}) → Future< UserCredential> -
Signs in using an email address and email sign-in link.
inherited
-
signInWithPhoneNumber(
String phoneNumber, [RecaptchaVerifier? verifier]) → Future< ConfirmationResult> -
Starts a sign-in flow for a phone number.
override
-
signInWithPopup(
AuthProvider provider) → Future< UserCredential> -
Authenticates a Firebase client using a popup-based OAuth authentication
flow.
override
-
signInWithProvider(
AuthProvider provider) → Future< UserCredential> -
Signs in with an AuthProvider using native authentication flow.
override
-
signInWithRedirect(
AuthProvider provider) → Future< void> -
Authenticates a Firebase client using a full-page redirect flow.
inherited
-
signOut(
) → Future< void> -
Signs out the current user.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
useAuthEmulator(
String host, int port, {bool automaticHostMapping = true}) → Future< void> -
Changes this instance to point to an Auth emulator running locally.
inherited
-
useEmulator(
String origin) → Future< void> -
Changes this instance to point to an Auth emulator running locally.
inherited
-
userChanges(
) → Stream< User?> -
Notifies about changes to any user updates.
override
-
verifyPasswordResetCode(
String code) → Future< String> -
Checks a password reset code sent to the user by email or other
out-of-band mechanism.
override
-
verifyPhoneNumber(
{String? phoneNumber, PhoneMultiFactorInfo? multiFactorInfo, required PhoneVerificationCompleted verificationCompleted, required PhoneVerificationFailed verificationFailed, required PhoneCodeSent codeSent, required PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout, String? autoRetrievedSmsCodeForTesting, Duration timeout = const Duration(seconds: 30), int? forceResendingToken, Object? multiFactorSession}) → Future< void> -
Starts a phone number verification process for the given phone number.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited