authflow library

A flexible, provider-based authentication toolkit for Flutter with stream-based auth state, customizable storage, and composable UI widgets.

Classes

AnonymousAuthProvider
Authentication provider that creates anonymous user sessions.
AuthBuilder
A builder widget that reacts to authentication state changes.
AuthConfig
Configuration for the AuthManager.
AuthEvent
Base class for authentication events
AuthEventBus
Simple event bus for auth events that allows components to subscribe to auth events.
AuthManager
Central manager for authentication state and operations.
AuthProvider
Abstract interface for authentication providers. Extend this class to implement custom authentication strategies.
AuthRegistry
Global registry for authentication providers.
AuthResult
Result of a login operation containing both user and token
AuthStorage
Abstract interface for storing and retrieving authentication state.
AuthToken
Represents authentication tokens with optional refresh token and expiration.
AuthUser
Abstract class representing a user model for authentication. Extend this class to implement a custom user model that fits your API structure.
DefaultAuthUser
Default implementation of AuthUser with minimal properties. Can be extended or replaced with a custom implementation.
EmailPasswordAuthProvider
Authentication provider for email/password login.
EmailPasswordCredentials
Credentials for email/password authentication
LoginEvent
Event dispatched when a user logs in
LogoutEvent
Event dispatched when a user logs out
MockEmailPasswordAuthProvider
Mock implementation of EmailPasswordAuthProvider for testing or demos.
SecureAuthStorage
Default implementation of AuthStorage using SharedPreferences for persistence.

Enums

AuthExceptionType
Types of authentication exceptions that can occur in the authentication flow.
AuthStatus
Auth status enum representing the current authentication state.

Typedefs

AuthStateRecord = ({AuthStatus status, AuthToken? token, AuthUser? user})
Record that holds the combined authentication state

Exceptions / Errors

AuthException
Standardized exception class for authentication errors in the AuthFlow package.