thunderid_flutter library

ThunderID Flutter SDK.

Provides identity management (sign-in, sign-up, token management, user profile) for Flutter apps by bridging to the native iOS and Android ThunderID Platform SDKs via Flutter platform channels.

Classes

An avatar:variant=anonymous_animal,content=<key> (or anonymous_entity) spec resolved to a bundled asset image, identified by its package-relative asset path (e.g. "packages/thunderid_flutter/assets/logo-icons/anonymous/fox.png").
AttributeSchema
Attribute schema metadata returned by GET /users/me/meta.
An avatar:shape=...,variant=one_letter|two_letter,content=...,colors=...,bg=... spec — a deterministically-generated gradient avatar with 1 or 2 overlaid letters. See AvatarLogoBadge for the widget that renders this.
AvatarLogoBadge
Renders a deterministically-generated gradient avatar with 1-2 overlaid letters, matching the visual output of the web SDK's generateAvatarDataUri-produced SVG data URI.
AvatarLogoRender
Deterministically derives the gradient colors, rotation angle, and initials for an AvatarVariant, matching the algorithm in the web SDK's generateAvatarDataUri.ts bit-for-bit (same hash, same palette index, same rotation math) so the two SDKs render identical avatars.
BaseCallback
Unstyled base variant (spec §8.2).
BaseLanguageSwitcher
Unstyled base variant (spec §8.3).
BaseSignIn
Unstyled base variant. builder receives SignInState to render any UI (spec §8.3).
BaseSignInButton
Unstyled base variant — for full customization (spec §8.2 Base* components).
BaseSignOutButton
Unstyled base variant for full style customization (spec §8.2).
BaseSignUp
Unstyled base variant (spec §8.3).
BaseSignUpButton
Unstyled base variant (spec §8.2).
BaseUserAvatar
Unstyled base variant — for full customization (spec §8.2 Base* components).
BaseUserDropdown
Unstyled base variant (spec §8.3).
BaseUserObject
Unstyled base variant (spec §8.3).
BaseUserProfile
Unstyled base variant (spec §8.3).
Callback
Handles the OAuth2 redirect callback URL (spec §8.4 Auth Flow).
CircularProgressIndicatorStub
EmbeddedFlowRequestConfig
EmbeddedFlowResponse
EmbeddedSignInPayload
An emoji:<glyph> spec — render glyph directly (e.g. in a Text widget).
FlowTemplateResolver
Resolves {{ t(key) }} and {{ meta(path) }} template literals embedded in server-returned component labels and placeholders.
I18nPreferences
LanguageSwitcher
Locale picker that updates the active language for component labels (spec §8.4 Presentation).
Loading
Renders indicator while the SDK is initializing or loading (spec §8.4 Control/Guard). Renders child (or nothing) once loading completes.
ProfileField
A schema-described profile field merged with its current value, ready to render.
A parsed application logo spec — emoji:<glyph>, avatar:shape=...,variant=...,content=...,colors=...,bg=..., or a bare URL — resolved into a renderable representation.
SignedIn
Renders child only when the user is authenticated. Renders fallback (or nothing) otherwise (spec §8.4 Control/Guard).
SignedOut
Renders child only when no user is authenticated (spec §8.4 Control/Guard).
SignIn
Full sign-in form that drives the Flow Execution API loop (spec §8.4 Presentation). Renders each step's inputs dynamically based on server-reported FlowStepData.
SignInButton
A pre-built sign-in button that integrates with ThunderIDProvider.
SignInOptions
SignInState
State exposed to BaseSignIn's builder.
SignOutButton
Triggers sign-out on tap. Accessible per WCAG 2.1 AA (spec §8.1).
SignOutOptions
SignUp
Full registration form driving the REGISTRATION flow (spec §8.4 Presentation).
SignUpButton
Initiates the sign-up flow on tap (spec §8.4 Actions).
SignUpOptions
SignUpState
ThemePreferences
ThunderIDClient
Flutter SDK client — Core Lib layer, delegates all protocol operations to the native iOS and Android Platform SDKs via ThunderIDChannel (spec §7.1).
ThunderIDConfig
Configuration for the ThunderID Flutter SDK (spec §5.2).
Renders an application logo spec string — emoji:<glyph>, avatar:shape=...,variant=...,content=...,colors=...,bg=..., or a bare URL — as the appropriate widget.
ThunderIDPreferences
Preferences for UI customization — theme and i18n (spec §5.3). Applies only when using ThunderID UI components; ignored by the protocol layer.
ThunderIDProvider
Provides a ThunderIDClient and reactive authentication state to the widget tree.
ThunderIDState
TokenExchangeRequestConfig
TokenResponse
TokenValidationConfig
A plain image URL — either the spec wasn't in a recognized scheme, or it named an anonymous_animal key that isn't in the curated set.
User
The authenticated user.
UserAvatar
A pre-built avatar that renders the authenticated user's profile picture, falling back to a deterministic two-color gradient circle with the user's initials when no picture is available.
UserDropdown
Avatar chip that opens a menu with profile and sign-out actions (spec §8.4 Presentation).
UserObject
Read-only display of the authenticated user's name and avatar (spec §8.4 Presentation).
UserProfile
Editable, schema-driven user profile.
UserProfileState
State exposed to BaseUserProfile's builder.

Enums

AvatarShape
Background shape an avatar: logo is rendered onto.
AvatarVariant
What's drawn on top of an avatar: logo's background.
FlowStatus
FlowType
ThunderIDErrorCode
All ThunderID SDK error codes (spec §10.2).

Extensions

AvatarShapeWire on AvatarShape
Wire-string (snake_case) for an AvatarShape, as used in the shape= spec param.
AvatarVariantWire on AvatarVariant
Wire-string (snake_case) for an AvatarVariant, as used in the variant= spec param.

Constants

kAnonymousAnimalNames → const List<String>
Keys of the curated "anonymous animal" badge icon set (lowercase), matching the avatar:...,variant=anonymous_animal,content=<key> logo spec scheme supported by the web SDK's logo picker.
kAnonymousEntityNames → const List<String>
Keys of the curated "anonymous entity" badge icon set (lowercase) — applications, organizations, resource servers, and agents — matching the avatar:...,variant=anonymous_entity,content=<key> logo spec scheme supported by the web SDK's logo picker.

Functions

anonymousAnimalAssetPath(String name) → String?
Resolves an avatar:...,variant=anonymous_animal,content=<name> spec's animal key to its bundled asset path, or null when name isn't one of kAnonymousAnimalNames (case-sensitive lowercase match — the wire content value is always lowercase already).
anonymousEntityAssetPath(String name) → String?
Resolves an avatar:...,variant=anonymous_entity,content=<name> spec's entity key to its bundled asset path, or null when name isn't one of kAnonymousEntityNames (case-sensitive lowercase match — the wire content value is always lowercase already).
buildProfileFields(Map<String, AttributeSchema> schema, UserProfile profile) → List<ProfileField>
Every non-credential schema attribute is shown by default.
buildProfileFieldsFromClaims(User? user) → List<ProfileField>
Builds a read-only field list directly from JWT/userinfo claims (no schema to save against).
buildUpdatePayload(String name, String value, bool isMultiValued, {String? type}) → Map<String, dynamic>
Builds the nested attributes payload segment for a single dot-path field save.
claimLabel(String key) → String
Humanizes a claim key for display: given_name -> "Given Name".
claimsDisplayName(User? user) → String
computeDisplayName(Map<String, List<String>> mappings, UserProfile profile) → String
Combines mapped firstName/lastName into a display name, falling back to username then id.
deepMergeAttributes(Map<String, dynamic> base, Map<String, dynamic> overrides) → Map<String, dynamic>
Recursively merges overrides onto base. The backend requires every required attribute present in any save, so a single-field edit still carries the rest of the profile along.
deriveAvatarContent(String seed, AvatarVariant variant) → String
Derives the literal content value for an avatar: spec from a raw seed string (e.g. an app name or session id), for callers that only have a seed and not an already-resolved spec — resolveLogoSpec uses this to fill in content when a spec omits it.
formatClaim(Object? value) → String?
mapAttribute(String key, Map<String, List<String>> mappings, UserProfile profile) → String?
Resolves a logical attribute name (firstName, email, picture...) to a value on profile by trying each candidate path in mappings in order, falling back to the built-in defaults.
resolveLogoSpec(String spec, {String fallbackSeedText = ''}) → ResolvedLogo
Resolves an application logo spec string into a renderable ResolvedLogo.
stringifyFieldValue(Object? rawValue) → String
Renders a raw field value for display/editing: joins list values, blanks out complex ones.
validateField(AttributeSchema schema, String value) → String?
Validates an edited field value against its schema: required first, then regex.

Exceptions / Errors

IAMException