firebase_ui_auth library

Classes

AccountDeletedAction
An action that is being called when user has deleted their account.
AuthCancelledAction
An action that is being called when user has cancelled an auth action.
AuthController
An abstract class that should be implemented by auth controllers of respective auth providers.
AuthFailed
An AuthState that indicates that something went wrong during authentication.
AuthFlow<T extends AuthProvider<AuthListener, AuthCredential>>
A class that provides a current auth state given an AuthProvider and implements shared authentication process logic.
AuthFlowBuilder<T extends AuthController>
A widget that is used to wire up the AuthFlows with the widget tree.
AuthListener
An interface that describes authentication process lifecycle.
AuthProvider<T extends AuthListener, K extends AuthCredential>
An interface that all auth providers should implement. Contains shared authentication logic.
AuthState
An abstract class for all auth states. AuthState transitions could be captured with an AuthStateChangeAction:
AuthStateChangeAction<T extends AuthState>
An action that is called when auth state changes. You can capture any type of AuthState using this action.
AuthStateListener<T extends AuthController>
A Widget that could be used to listen auth state transitions.
A state athat indicates that the sign in link was sent and the user should follow the link from their email to complete the sign in process. UIs often reflect this state with a message that tells the user to follow the link in their email.
AwaitingEmailAndPassword
A state that indicates that email flow is not initialized with an email and password. UI should show an EmailForm when EmailAuthFlow's current state is AwaitingEmailAndPassword.
AwaitingPhoneNumber
An AuthState that indicates that PhoneAuthFlow is not yet initialized wuth the phone number. UI should provide a way to submit a phone number.
CredentialLinked
Indicates that the auth credential was successfully linked with the currently signed in user account.
CredentialReceived
Indicates that the auth credential was successfully received. This is an intermediate state that should transition to either SignedIn, CredentialLinked or AuthFailed depending on AuthAction. Could be used to reflect the loading state on the ui.
DeleteAccountButton
A button that triggers the deletion of the user's account.
DifferentMethodSignInDialog
A dialog that is shown when the user tries to sign in with a provider that wasn't previously used, but there are other providers for a given email.
DifferentMethodSignInView
A view that renders a list of providers that were previously used by the user to authenticate.
DifferentSignInMethodsFound
An AuthState that indicates that there are different auth providers associated with an email that was used to authenticate.
DisplayNameChangedAction
An action that is being called when user has changed their display name.
EditableUserDisplayName
A widget that displays user name and allows to edit it. If the user name is not provided by neither of the providers, a text field is being shown. Otherwise, a user name is rendered with the edit icon.
EmailAuthController
A controller interface of the EmailAuthFlow.
EmailAuthFlow
An auth flow that allows authentication with email and password.
EmailAuthListener
A listener of the EmailAuthFlow flow lifecycle.
EmailAuthProvider
An AuthProvider that allows to authenticate using email and password.
EmailForm
An email form widget.
EmailFormStyle
An object that is being used to apply styles to the email form.
EmailInput
An input that allows to enter an email address.
EmailLinkAuthController
A controller interface of the EmailLinkFlow.
EmailLinkAuthListener
A listener of the EmailLinkFlow lifecycle.
EmailLinkAuthProvider
An AuthProvider that allows to authenticate using a link that is being sent to the user's email.
EmailLinkFlow
A flow that implements a sign in flow with a link that is sent to the user's email.
EmailLinkSignInAction
An action that indicates that email link sign in flow was triggered from the UI.
EmailLinkSignInButton
A button that starts an email link sign in flow.
EmailLinkSignInScreen
A screen that provides a UI for authentication using email link.
EmailLinkSignInView
A view that could be used to build a custom EmailLinkSignInScreen.
EmailSignUpDialog
A dialog Widget that allows to create a new account using email and password or to link current account with an email.
EmailVerificationController
A ValueNotifier that manages the email verification process.
EmailVerificationScreen
A screen that contains hints of how to verify the email. A verification email is being sent automatically when this screen is opened.
EmailVerifiedAction
An action that is being called when email was successfully verified.
ErrorText
A widget which displays error text for a given Firebase error code.
FetchingProvidersForEmail
An AuthState that indicates that there is a lookup of available providers for an email in progress.
FindProvidersForEmailView
A view that could be used to build a custom UniversalEmailSignInScreen.
FirebaseUIAction
An abstract class that all actions implement. The following actions are available:
FirebaseUIActions
An inherited widget that provides a list of actions down the widget tree.
FirebaseUIAuth
FirebaseUIStyle
An abstract class that should be implemented by all styling classes.
FirebaseUITheme
FirebaseUI styles provider widget.
ForgotPasswordAction
An action that indicates that password recovery was triggered from the UI.
ForgotPasswordButton
A button that has a localized "Forgot password" label.
ForgotPasswordScreen
A password reset screen.
ForgotPasswordView
A view that could be used to build a custom ForgotPasswordScreen.
LayoutFlowAwarePadding
Padding widget that takes into account current layout flow. If nearest ancestor is Row (or Flex with Flex.direction equal to Axis.horizontal) – horizontal paddings are ignored. Otherwise vertical paddings are ignored.
LoginView
A view that could be used to build a custom SignInScreen or RegisterScreen.
MFARequired
An AuthState that indicates that multi-factor authentication is required.
OAuthController
A controller interface of the OAuthFlow.
OAuthFlow
A flow that allows to authenticate using OAuth providers.
OAuthProviderButton
A button that is used to sign in with an OAuth provider.
PasswordInput
An input that allows to enter a password.
PhoneAuthController
A controller interface of the PhoneAuthFlow.
PhoneAuthFlow
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.
PhoneAuthListener
A listener of the PhoneAuthFlow lifecycle.
PhoneAuthProvider
An AuthProvider that allows to authenticate using a phone number.
PhoneInput
An input that allows to enter a phone number and select a country code.
PhoneInputScreen
A screen displaying a fully styled phone number entry screen, with a country-code picker.
PhoneInputState
A state of the PhoneInput.
PhoneInputView
A view that could be used to build a custom PhoneInputScreen.
PhoneVerificationButton
A button that triggers phone verification flow.
PhoneVerificationFailed
Indicates that the phone verification failed. exception contains the details describing what exactly went wrong.
PhoneVerified
An AuthState that indicates that the SMS code was sucessfully veriied and a fba.AuthCredential was obtained.
ProfileScreen
A pre-built profile screen that allows to link more auth providers, unlink auth providers, edit user name and delete the account. Could also contain a user-defined content.
ReauthenticateDialog
A dialog that prompts the user to re-authenticate their account Used to confirm destructive actions (like account deletion or disabling MFA).
ReauthenticateView
A view that could be used to build a custom ReauthenticateDialog.
RegisterScreen
A screen displaying a fully styled Registration flow for Authentication.
A state that indicates that the sign in link is being sent. UIs often reflect this state with a loading indicator.
SignedIn
An AuthState that indicates that the user has successfully signed in.
SignedOutAction
An action that is being called when user has signed out.
SigningIn
Indicates that sign in is in progress. Could be used to reflect the loading state on the ui.
SigningUp
A state that indicates that user registration is in progress. UIs often reflect this state with a loading indicator.
SignInScreen
A screen displaying a fully styled Sign In flow for Authentication.
SignOutButton
A button that signs out the user when pressed.
SMSCodeInput
A widget that allows the user to enter the SMS code sent to the user's phone.
SMSCodeInputScreen
A screen displaying a UI which allows users to enter an SMS validation code sent from Firebase.
SMSCodeInputState
SMSCodeInputView
A view that could be used to build a custom SMSCodeInputScreen.
SMSCodeRequested
An AuthState that indicates that the phone number was submitted and the SMS code is being sent. UIs often reflect this state with a loading indicator.
SMSCodeRequestedAction
An action that is called when user requests a sign in with the phone number. Could be used to show a SMSCodeInputScreen or trigger a custom logic:
SMSCodeSent
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.
SocialIcons
Font icons of the social networks.
Uninitialized
A default AuthState for many auth flows.
UniversalEmailSignInController
A controller interface of the UniversalEmailSignInFlow.
UniversalEmailSignInFlow
An auth flow that resolves providers that are accosicatied with the given email.
UniversalEmailSignInListener
A UniversalEmailSignInFlow lifecycle listener.
UniversalEmailSignInProvider
A provider that resolves available authentication methods for a given email.
UniversalEmailSignInScreen
A screen that allows to resolve previously used providers for a given email.
UserAvatar
A widget that displays the user's avatar.
UserCreated
A state that indicates that a new user account was created.
VerifyPhoneAction
An action that is called when user requests a sign in with the phone number. Could be used to show a PhoneInputScreen or trigger a custom logic:

Enums

AuthAction
An authentication action to perform.
ButtonVariant
An enumeration of the possible button variants.
EmailVerificationState
All possible states of the email verification process.
OAuthButtonVariant
Either button should display icon and text or only icon.

Extensions

OAuthHelpers on User

Functions

defaultOnAuthError(AuthProvider<AuthListener, AuthCredential> provider, Object error) → void
Default error handler that starts MFA flow if FirebaseAuthMultiFactorException is thrown.
getControllerForState(AuthState state) AuthController
Allows getting an AuthController that caused an AuthState transition. Calling getControllerForState is only allowed from a FirebaseUIAction callback:
localizedErrorText(String? errorCode, FirebaseUILocalizationLabels labels) String?
providerIcon(BuildContext context, String providerId) IconData
Resolves an icon given a providerId.
setFirebaseUiIsTestMode(bool isTestMode) → void
showDifferentMethodSignInDialog({required BuildContext context, required List<String> availableProviders, required List<AuthProvider<AuthListener, AuthCredential>> providers, FirebaseAuth? auth, VoidCallback? onSignedIn}) Future<void>
Shows DifferentMethodSignInDialog.
showForgotPasswordScreen({required BuildContext context, FirebaseAuth? auth, String? email, WidgetBuilder? subtitleBuilder, WidgetBuilder? footerBuilder}) Future<void>
Opens a ForgotPasswordScreen.
showReauthenticateDialog({required BuildContext context, required List<AuthProvider<AuthListener, AuthCredential>> providers, FirebaseAuth? auth, VoidCallback? onSignedIn, VoidCallback? onPhoneVerfifed, String? actionButtonLabelOverride}) Future<bool>
Shows ReauthenticateDialog.
startMFAVerification({required BuildContext context, required MultiFactorResolver resolver, FirebaseAuth? auth, SMSCodeInputScreenBuilder? smsCodeInputScreenBuilder}) Future<UserCredential>
startPhoneVerification({required BuildContext context, AuthAction? action, FirebaseAuth? auth, MultiFactorSession? multiFactorSession, PhoneMultiFactorInfo? hint, List<FirebaseUIAction> actions = const []}) Future<void>
Opens PhoneInputScreen.

Typedefs

AuthFlowBuilderCallback<T extends AuthController> = Widget Function(BuildContext context, AuthState state, T ctrl, Widget? child)
A callback that is being called every time the AuthFlow changes it's state. Returned widget is rendered as a child of AuthFlowBuilder.
AuthStateListenerCallback<T extends AuthController> = bool? Function(AuthState oldState, AuthState state, T controller)
AuthViewContentBuilder = Widget Function(BuildContext context, AuthAction action)
DeleteFailedCallback = void Function(Exception exception)
HeaderBuilder = Widget Function(BuildContext context, BoxConstraints constraints, double shrinkOffset)
A builder that builds the contents of the header. Used only on mobile platforms.
PhoneNumberSubmitCallback = void Function(String phoneNumber)
ProvidersFoundCallback = void Function(String email, List<String> providers)
A callback that is being called when providers fetch request is completed.
SideBuilder = Widget Function(BuildContext context, BoxConstraints constraints)
A builder that builds a contents of a page displayed on a side of of the main authentication related UI.
SignInRequiredCallback = Future<bool> Function()
SMSCodeRequestedCallback = void Function(BuildContext context, AuthAction? action, Object flowKey, String phoneNumber)
SMSCodeSubmitCallback = void Function(String smsCode)
StateTransitionListener<T extends AuthController> = void Function(AuthState oldState, AuthState newState, T controller)
A callback that is being called when AuthFlow changes it's state.

Exceptions / Errors

AuthCancelledException
An exception that is being thrown when user cancels the authentication process.
AutoresolutionFailedException
A state that indicates that autoresolution has failed. This doesn't necessarily mean that the code was invalid, sometimes a device doesn't support SMS code autoresolution.