PhoneAuthFlow class
A state that indicates that the SMS code was successfully sent and the user should submit it. UI should provide a way to submit the SMS code.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
AuthState> - AuthFlow<
PhoneAuthProvider> - PhoneAuthFlow
- Implemented types
Constructors
- PhoneAuthFlow({required PhoneAuthProvider provider, FirebaseAuth? auth, AuthAction? action})
- A state that indicates that the SMS code was successfully sent and the user should submit it. UI should provide a way to submit the SMS code.
Properties
- action ↔ AuthAction
-
An authentication action to perform.
getter/setter pairinherited
- auth ↔ FirebaseAuth
-
The
FirebaseAuth
instance used to perform authentication against. By default,FirebaseAuth.instance
is used.getter/setter pairinherited - confirmationResult ↔ ConfirmationResult?
-
Web-only object that should be used to verify the phone number.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialState → AuthState
-
An initial auth state. Usually Uninitialized, but varies for different
auth flows.
finalinherited
- onDispose ↔ VoidCallback
-
/// A callback that is being called when auth flow is complete and is being
desposed (e.g. when AuthFlowBuilder widget is unmounteed from the widget
tree).
getter/setter pairinherited
- provider → PhoneAuthProvider
-
Current AuthProvider that is being used to authenticate the user.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ AuthState
-
The current value stored in this notifier.
getter/setter pairinherited
- verificationId ↔ String?
-
A verification ID that is being used to verify the phone number.
Not available on web, confirmationResult should be used instead.
getter/setter pair
Methods
-
acceptPhoneNumber(
String phoneNumber, [MultiFactorSession? multiFactorSession]) → void -
Initializes the flow with a phone number. This method should be called
after user submits a phone number.
override
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onBeforeProvidersForEmailFetch(
) → void -
Called before an attempt to fetch available providers for the email.
inherited
-
onBeforeSignIn(
) → void -
Called right before the authentication process starts.
inherited
-
onCanceled(
) → void -
Called when the user cancells the sign in process.
inherited
-
onCodeSent(
String verificationId, [int? forceResendToken]) → void -
Called when the SMS code was sent.
UI should provide a way to enter the code.
override
-
onConfirmationRequested(
ConfirmationResult result) → void -
Caled when the SMS code was requested.
UIs usually reflect this state with a loading indicator.
Called only on web.
override
-
onCredentialLinked(
AuthCredential credential) → void -
Called if the credential was successfully linked with the user account.
inherited
-
onCredentialReceived(
AuthCredential credential) → void -
Called before an attempt to link the credential with currently signed in
user account.
inherited
-
onDifferentProvidersFound(
String email, List< String> providers, AuthCredential? credential) → void -
Called when available providers for the email were successfully fetched.
inherited
-
onError(
Object error) → void -
Called if an error occured during the authentication process.
inherited
-
onMFARequired(
MultiFactorResolver resolver) → void -
Called when the user has to complete MFA.
inherited
-
onSignedIn(
UserCredential credential) → void -
Called if the user has successfully signed in.
inherited
-
onSMSCodeRequested(
String phoneNumber) → void -
Caled when the SMS code was requested.
UIs usually reflect this state with a loading indicator.
Is not supported on web.
override
-
onVerificationCompleted(
PhoneAuthCredential credential) → void -
Called when the phone number was successfully verified.
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void -
Resets the controller to initial state.
Usuall called when user cancels the authentication flow.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verifySMSCode(
String code, {String? verificationId, ConfirmationResult? confirmationResult, MultiFactorSession? multiFactorSession}) → void -
Triggers an SMS code verification.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited