authsome_flutter_ui library

Pre-built Material Design 3 authentication UI for AuthSome.

Provides styled screens, headless builder widgets, and user management components that integrate with AuthProvider from authsome_flutter.

Usage:

import 'package:authsome_flutter_ui/authsome_flutter_ui.dart';

// Wrap your app with AuthProvider, then use pre-built screens:
SignInForm(
  onSuccess: () => Navigator.pushReplacementNamed(context, '/home'),
  onSignUpTap: () => Navigator.pushNamed(context, '/sign-up'),
)

Classes

ACSRequest
AdminAppResponse
AdminCatalogProvider
AdminCatalogResponse
AdminCreateConnectionResponse
AdminDeleteAppRequest
AdminDeleteConnectionResponse
AdminDeleteProviderResponse
AdminDeleteServiceAccountRequest
AdminDeleteUserRequest
AdminGetServiceAccountRequest
AdminGetUserRequest
AdminImpersonateRequest
AdminListConnectionsResponse
AdminListOrgsRequest
AdminListProvidersResponse
AdminListServiceAccountsRequest
AdminListUsersRequest
AdminPlatformOwnerResponse
AdminProvider
AdminProviderResponse
AdminRevokePlatformOwnerRequest
AdminServiceAccountAPIKeyResponse
AdminServiceAccountListResponse
AdminServiceAccountResponse
AdminStatsRequest
AdminStatsResponse
AdminStopImpersonationRequest
AdminUnbanUserRequest
AdminUserListResponse
AuthAuthenticated
User is authenticated.
AuthCard
Layout wrapper for auth forms — a centered Material 3 card with title, description, optional logo, and footer.
AuthClient
Auto-generated AuthSome API client.
AuthClientConfig
Configuration for the AuthSome API client.
AuthConfig
Configuration for the AuthSome client.
AuthEmailNotVerified
Sign-in attempted but the account's email is not yet verified. The form should switch to the inline verification panel.
AuthError
An error occurred during authentication.
AuthErrorType
Standard error-category strings emitted by the AuthSome backend. Keep in sync with the TypeScript AuthClientError constants.
AuthGuard
A widget that gates access to child based on the current auth state.
AuthIdle
Initial idle state before initialization.
AuthLoading
Auth is loading (sign-in, sign-up, refresh, etc.).
AuthManager
AuthManager is the core state machine that drives authentication.
AuthMethod
AuthMfaRequired
MFA challenge required before full authentication.
AuthNotifier
AuthNotifier wraps AuthManager as a ChangeNotifier for Flutter.
AuthorizeRequest
AuthProvider
AuthProvider provides authentication state to the widget tree.
AuthResponse
AuthRouterScope<T extends Object>
Caches a value (typically a router) built from the resolved AuthNotifier. The cached value's identity is stable across the widget's lifetime, even when the notifier fires notifyListeners().
AuthSomeClient
AuthSomeClient extends the auto-generated client with backward-compatible convenience methods that AuthManager depends on.
AuthState
Authentication state (sealed class for exhaustive matching).
AuthTheme
Provides AuthThemeData to descendant widgets.
AuthThemeData
Theme data for AuthSome UI widgets.
AuthUnauthenticated
User is not authenticated.
AuthVerificationPending
Sign-up completed; awaiting email verification before the session becomes active. Mirrors React verification_pending.
BrandingConfig
BulkError
BulkImportResult
BulkRevokeSessionsRequest
BulkRevokeSessionsResponse
CallbackRequest
CallbackResponse
CancelSubscriptionRequest
ChallengeRequest
ChallengeResponse
ChangePasswordForm
A change-password form with current, new, and confirm password fields.
ChangePlanRequest
CheckEntitlementRequest
CheckSlugRequest
ClientConfig
Client configuration returned by the backend.
ClientConfigBranding
ClientConfigCaptcha
ClientConfigEmailVerification
ClientConfigFieldValidation
ClientConfigMFA
ClientConfigResponse
ClientConfigSelectOption
ClientConfigSignupField
ClientConfigSocial
ClientConfigSocialProvider
ClientConfigSSO
ClientConfigSSOConnection
ClientConfigToggle
CloneEnvironmentResponse
Config
Connection
CouponResponse
CreateClientResponse
CreateCouponRequest
CreateKeyRequest
CreateKeyResponse
CreatePlanRequest
CreateSubscriptionRequest
CredentialInfo
Definition
DefinitionGroup
DeleteAccountRequest
DeleteAppClientConfigRequest
DeleteAppSessionConfigRequest
DeleteClientRequest
DeleteCouponRequest
DeleteDeviceRequest
DeleteOrgRequest
DeleteRequest
DeleteResponse
DeleteSettingRequest
DeleteTeamRequest
DeleteWebhookRequest
Device
DeviceAuthRequest
DeviceAuthResponse
DeviceCompleteRequest
DeviceCompleteResponse
DeviceList
A list view of the user's registered devices with trust and delete actions.
DeviceListResponse
DisableRequest
DisableResponse
DiscoveryRequest
DiscoveryResponse
Email
EmailVerificationForm
An email-verification form with a 6-digit OtpInput and resend button.
EnrollRequest
EnrollResponse
EntitlementResponse
Environment
EnvironmentListResponse
EnvironmentSettingsResponse
ErrorDisplay
Displays an error message in a styled container.
ExportDataRequest
FeatureInput
ForgotPasswordForm
A forgot-password form that sends a reset link to the provided email.
ForgotPasswordResponse
GetActiveSubRequest
GetAppClientConfigRequest
GetAppSessionConfigRequest
GetClientConfigRequest
GetDeviceRequest
GetInvoiceRequest
GetMeRequest
GetOrgRequest
GetPlanRequest
GetTeamRequest
GetWebhookRequest
GroupRef
GroupResource
HealthResponse
IntrospectResponse
IntrospectUser
Invitation
InvitationListResponse
InvoiceResponse
KeyListItem
ListAuthMethodsRequest
ListAuthMethodsResponse
ListClientsRequest
ListClientsResponse
ListConsentsRequest
ListCouponsRequest
ListCouponsResponse
ListDefinitionsResponse
ListDevicesRequest
ListEnvironmentsRequest
ListInvitationsRequest
ListInvoicesRequest
ListInvoicesResponse
ListKeysRequest
ListKeysResponse
ListMembersRequest
ListNamespaceDefinitionsRequest
ListOrgsRequest
ListPlansRequest
ListPlansResponse
ListRequest
ListResponse
ListRolesRequest
ListSessionsRequest
ListSettingsDefinitionsRequest
ListSubscriptionsRequest
ListSubscriptionsResponse
ListTeamsRequest
ListWebhooksRequest
LoadingIndicator
A centered CircularProgressIndicator with configurable size.
LoginBeginRequest
LoginBeginResponse
LoginFinishRequest
LoginFinishResponse
LoginRequest
LoginResponse
MagicLinkConfig
MagicLinkForm
A magic-link form that sends a sign-in link to the user's email.
MarkInvoicePaidRequest
Member
MemberListResponse
MemberRef
MemoryTokenStorage
In-memory token storage (lost on app restart).
Meta
MfaChallengeForm
A multi-method MFA challenge form wrapped in an AuthCard.
MfaChallengeFormBuilder
A headless MFA challenge form widget that manages code input state.
MfaChallengeFormState
Immutable snapshot of the MFA challenge form state, passed to the builder.
MfaConfig
Name
OAuth2Client
ObjectFieldDef
OrDivider
A horizontal divider with centered text, typically "or".
Organization
OrgListResponse
OrgSwitcher
A popup menu for switching between organizations and creating new ones.
OtpInput
A 6-digit OTP input that auto-submits on completion.
PasskeyAuthenticator
A platform-specific WebAuthn / passkey authenticator.
PasskeyConfig
PasskeyLoginButton
PasswordConfig
PasswordInput
A TextField with a suffix button to toggle password visibility.
Permission
PermissionListResponse
PlanIDRequest
PlanResponse
RecoveryRegenerateRequest
RecoveryRegenerateResponse
RecoveryVerifyRequest
RecoveryVerifyResponse
RegisterBeginRequest
RegisterBeginResponse
RegisterFinishRequest
RegisterFinishResponse
RemoveMemberRequest
ResetPasswordForm
A reset-password form that takes a token and submits a new password.
ResolvedSetting
ResolvedSettingResponse
ResolvedSettingsResponse
ResolveSettingRequest
ResolveSettingsRequest
Response
RevokeKeyRequest
RevokeRequest
RevokeSessionRequest
Role
RoleListResponse
scimGroupPathParam
scimUserPathParam
ScopeValue
SecureTokenStorage
TokenStorage backed by FlutterSecureStorage.
SelectOption
SendRequest
SendResponse
Session
Session tokens returned after authentication / refresh.
SessionList
A list view of the user's active sessions with revoke actions.
SessionListResponse
Settings
SettingValueResponse
SignInForm
A multi-step sign-in form wrapped in an AuthCard.
SignInFormBuilder
A headless sign-in form widget that manages form state internally.
SignInFormState
Immutable snapshot of the sign-in form state, passed to the builder.
SignOutRequest
SignUpForm
A multi-step sign-up form wrapped in an AuthCard.
SignUpFormBuilder
A headless sign-up form widget that manages form state internally.
SignUpFormState
Immutable snapshot of the sign-up form state, passed to the builder.
SlugAvailableResponse
SMSSendRequest
SMSSendResponse
SmsSendResult
Result of sending an SMS code for MFA.
SMSVerifyRequest
SMSVerifyResponse
SocialButtons
Renders social login buttons in the specified layout.
SocialConfig
SocialProvider
A social login provider definition.
SocialProviderConfig
Social provider info from the backend.
SsoConfig
SSOConnectionConfig
SSO connection info from the backend.
StartRequest
StartResponse
StatusResponse
SubIDRequest
SwitchOrgResponse
Team
TeamListResponse
TokenRequest
TokenResponse
TokenStorage
Interface for persisting tokens across sessions.
TrustDeviceRequest
UIMetadata
UnenforceSettingRequest
UnlinkAuthMethodRequest
UnlinkAuthMethodResponse
UnsupportedPasskeyAuthenticator
Default authenticator: reports isAvailable == false and throws on every call. Used as the fallback when no platform implementation is provided.
UsageItemResponse
UsageSummaryRequest
UsageSummaryResponse
User
UserAvatar
A circular avatar that displays the user's profile image or initials.
UserButton
A user avatar button that opens a popup menu with account actions.
UserButtonMenuItem
A custom menu item for UserButton.
UserInfo
UserInfoRequest
UserProfileCard
A card that displays the current user's profile and allows inline editing.
UserResource
UserRoleListResponse
Validation
VerifyMFARequest
VerifyMFAResponse
VerifyRequest
VerifyResponse
VisibilityCondition
VoidInvoiceRequest
Webhook
WebhookListResponse

Enums

AuthCardAlign
Horizontal alignment of the title + description text inside an AuthCard.
LoadingSize
Size presets for the loading indicator.
MfaMethod
MFA method identifiers.
SocialButtonLayout
Layout options for social login buttons.
UserAvatarSize
Size presets for UserAvatar.

Extensions

AuthClientExceptionTyped on AuthClientException
AuthContext on BuildContext
Extension for convenient access to auth state from BuildContext.

Functions

buildSocialIcon(String providerId, {double size = 20}) Widget?
Builds a social icon widget for the given provider ID.
defaultPasskeyAuthenticator() PasskeyAuthenticator
Returns the platform-appropriate PasskeyAuthenticator. Cached at the call site is fine — implementations are stateless.
prepareCreationOptions(Map<String, dynamic> options) Map<String, dynamic>
Prepare the options object returned by /v1/passkeys/register/begin for navigator.credentials.create({ publicKey }).
prepareRequestOptions(Map<String, dynamic> options) Map<String, dynamic>
Prepare the options object returned by /v1/passkeys/login/begin for navigator.credentials.get({ publicKey }) (Web) or its native equivalent.
serializeAssertion({required String id, required dynamic rawId, required String type, required dynamic clientDataJson, required dynamic authenticatorData, required dynamic signature, dynamic userHandle, String? authenticatorAttachment}) Map<String, dynamic>
Build the credential JSON payload expected by the /finish endpoints.

Typedefs

MfaChallengeFormWidgetBuilder = Widget Function(MfaChallengeFormState state)
Builder callback that receives the current MfaChallengeFormState.
SignInFormWidgetBuilder = Widget Function(SignInFormState state)
Builder callback that receives the current SignInFormState.
SignUpFormWidgetBuilder = Widget Function(SignUpFormState state)
Builder callback that receives the current SignUpFormState.

Exceptions / Errors

AuthClientException
Exception thrown by the AuthSome API client.