layou_auth library

Firebase Auth package with Google, Apple, and Email sign-in/linking support.

Provides ready-to-use widgets and Riverpod providers for authentication.

Classes

AppleProviderConfig
Configuration for Apple Sign-In
AuthError<T>
Error result
AuthProviderConfig
Base class for auth provider configuration
AuthResult<T>
Result wrapper for auth operations
AuthService
Core authentication service
AuthSuccess<T>
Success result
AuthUser
Minimal user representation from Firebase Auth
EmailProviderConfig
Configuration for Email/Password authentication
GoogleProviderConfig
Configuration for Google Sign-In
LayouAppleButton
Apple sign-in/link button
LayouAuth
Main entry point for LayouAuth
LayouAuthActions
Auth actions notifier for sign-in/link/sign-out operations
LayouAuthConfig
Main configuration for LayouAuth
LayouAuthSection
Inline auth section widget for embedding in settings or profile pages
LayouAuthSheet
Main auth bottom sheet widget
LayouAuthSheetActions
Actions available to custom builder
LayouAuthSheetState
State passed to custom builder
LayouAuthStrings
Localized strings for LayouAuth widgets
LayouAuthTheme
Theme configuration for LayouAuth widgets
LayouCredentialInUseSheet
Bottom sheet that appears when a credential is already in use on another account. Asks the user if they want to sign in with the existing account instead.
LayouDeleteAccountSheet
Bottom sheet for account deletion with reauthentication support
LayouEmailButton
Email sign-in/link button
LayouEmailForm
Email/password form widget
LayouGoogleButton
Google sign-in/link button

Enums

AuthMethod
Auth methods enum
LayouAuthMode
Auth mode for the sheet

Properties

layouAuthActionsProvider → AutoDisposeAsyncNotifierProviderImpl<LayouAuthActions, void>
Auth actions notifier for sign-in/link/sign-out operations
final
layouAuthConfigProvider → Provider<LayouAuthConfig>
Provides the LayouAuth config
final
layouAuthServiceProvider → Provider<AuthService>
Provides the AuthService
final
layouAuthStateProvider → StreamProvider<AuthUser?>
Stream of auth state changes
final
layouCurrentUserProvider → AutoDisposeProvider<AuthUser?>
Current auth user (nullable)
final
layouHasAppleProvider → AutoDisposeProvider<bool>
Whether Apple is linked
final
layouHasEmailProvider → AutoDisposeProvider<bool>
Whether Email is linked
final
layouHasGoogleProvider → AutoDisposeProvider<bool>
Whether Google is linked
final
layouIsAnonymousProvider → AutoDisposeProvider<bool>
Whether current user is anonymous
final
layouIsAuthenticatedProvider → AutoDisposeProvider<bool>
Whether user is authenticated
final
layouLinkedProvidersProvider → AutoDisposeProvider<List<String>>
List of linked provider IDs
final

Functions

layouAuthConfig(Ref<Object?> ref) LayouAuthConfig
Provides the LayouAuth config
layouAuthService(Ref<Object?> ref) AuthService
Provides the AuthService
layouAuthState(Ref<Object?> ref) Stream<AuthUser?>
Stream of auth state changes
layouCurrentUser(Ref<Object?> ref) AuthUser?
Current auth user (nullable)
layouHasApple(Ref<Object?> ref) bool
Whether Apple is linked
layouHasEmail(Ref<Object?> ref) bool
Whether Email is linked
layouHasGoogle(Ref<Object?> ref) bool
Whether Google is linked
layouIsAnonymous(Ref<Object?> ref) bool
Whether current user is anonymous
layouIsAuthenticated(Ref<Object?> ref) bool
Whether user is authenticated
layouLinkedProviders(Ref<Object?> ref) List<String>
List of linked provider IDs

Typedefs

LayouAuthConfigRef = ProviderRef<LayouAuthConfig>
LayouAuthServiceRef = ProviderRef<AuthService>
LayouAuthStateRef = StreamProviderRef<AuthUser?>
LayouCurrentUserRef = AutoDisposeProviderRef<AuthUser?>
LayouHasAppleRef = AutoDisposeProviderRef<bool>
LayouHasEmailRef = AutoDisposeProviderRef<bool>
LayouHasGoogleRef = AutoDisposeProviderRef<bool>
LayouIsAnonymousRef = AutoDisposeProviderRef<bool>
LayouIsAuthenticatedRef = AutoDisposeProviderRef<bool>
LayouLinkedProvidersRef = AutoDisposeProviderRef<List<String>>

Exceptions / Errors

AuthException
Base class for all auth exceptions
CredentialAlreadyInUseException
Credential is already linked to another account
EmailAlreadyInUseException
Email is already in use
InvalidEmailException
Invalid email format
LinkingFailedException
Account linking failed
NetworkException
Network error
NoUserException
No authenticated user found
RequiresRecentLoginException
Requires recent login (for sensitive operations)
SignInFailedException
Sign-in failed
UnknownAuthException
Unknown auth error
UserCancelledException
User cancelled the sign-in flow
UserDisabledException
User account is disabled
UserNotFoundException
User not found
WeakPasswordException
Password is too weak
WrongPasswordException
Wrong password