blitzware_flutter_sdk library

BlitzWare Flutter SDK

A comprehensive authentication SDK for Flutter applications providing secure OAuth 2.0/OIDC authentication with role-based access control.

Classes

AuthenticatedGuard
Widget that only shows content when user is authenticated
AuthStateBuilder
Widget that shows different content based on authentication state
BlitzWareAuthProvider
BlitzWare authentication provider using ChangeNotifier
BlitzWareAuthService
BlitzWare authentication service
BlitzWareConfig
Configuration for BlitzWare authentication
BlitzWareLoginButton
Login button widget with built-in loading state
BlitzWareLogoutButton
Logout button widget with built-in loading state
BlitzWareRole
Represents a user role in the BlitzWare system
BlitzWareUser
Represents a BlitzWare user
BlitzWareUtils
Utility functions for BlitzWare authentication (backward compatibility)
RoleBasedBuilder
Widget that shows different content for different roles
RoleGuard
Widget that shows content based on user roles
TokenIntrospectionResponse
Token introspection response (RFC 7662 OAuth2 Token Introspection)
TokenSet
Token set containing access and refresh tokens
UnauthenticatedGuard
Widget that only shows content when user is unauthenticated
UserInfoDisplay
User info display widget

Enums

AuthenticationState
Authentication state
AuthErrorCode
Authentication error codes matching React Native SDK

Extensions

AuthErrorCodeExtension on AuthErrorCode
BlitzWareAuthProviderRoles on BlitzWareAuthProvider
Convenience methods for role-based access control
BlitzWareConfigExtensions on BlitzWareConfig
Extension methods for BlitzWareConfig
BlitzWareUserExtensions on BlitzWareUser
Extension methods for BlitzWareUser

Functions

generateCodeChallenge(String verifier) → String
Generate PKCE code challenge from verifier
generateCodeVerifier() → String
Generate PKCE code verifier
generateRandomString(int length) → String
Generate cryptographically secure random string
getUserDisplayName(BlitzWareUser? user) → String
getUserRoles(BlitzWareUser? user) → List<String>
hasAllRoles(BlitzWareUser? user, List<String> roleNames) → bool
hasAnyRole(BlitzWareUser? user, List<String> roleNames) → bool
hasRole(BlitzWareUser? user, String roleName) → bool
Global functions for public API (matching React Native SDK)
isTokenExpired(DateTime? expiresAt) → bool
Check if a token is expired (with 5-minute buffer)
validateConfig(BlitzWareConfig config) → List<String>
Validate BlitzWare configuration

Exceptions / Errors

AuthenticationException
Specific authentication exceptions
BlitzWareException
BlitzWare authentication exception
ConfigurationException
NetworkException
TokenException