authflow 0.0.1
authflow: ^0.0.1 copied to clipboard
A flexible, provider-based authentication toolkit for Flutter with stream-based auth state, customizable storage, and composable UI widgets.
0.0.1 May 19, 2025 #
Initial release of the Authflow package with the following features:
Core Components #
AuthToken: Token management with access token, refresh token, and expiration handlingAuthUser: Abstract user model withDefaultAuthUserimplementationAuthStorage: Interface for persisting authentication stateSecureAuthStorage: Implementation using SharedPreferences for secure storageAuthProvider: Abstract interface for authentication providersAuthStatus: Enum representing authentication states (authenticated, unauthenticated, loading)AuthRegistry: Global registry for managing authentication providersAuthManager: Central orchestrator for authentication operationsAuthConfig: Configuration system for the auth managerAuthEventBus: Reactive event system using RxDart's BehaviorSubject for auth state changes
Authentication Providers #
AnonymousAuthProvider: Provider for anonymous authenticationEmailPasswordAuthProvider: Base provider for email/password authenticationMockEmailPasswordAuthProvider: Implementation for testing or demos
Events #
LoginEvent: Dispatched when a user logs inLogoutEvent: Dispatched when a user logs out
Flutter Widgets #
AuthBuilder: Stream-based widget for building UIs based on auth state
Features #
- Multiple authentication provider support
- Reactive streams for auth status, user, and token
- Secure token and user persistence
- Manual session injection capabilities
- Global event system for cross-app auth state management