PasskeyUiTheme class

Centralized styling for every widget in passkey_ui_kit.

Pass a PasskeyUiTheme to any widget to override its look. Anything you leave null falls back to the ambient Theme.of(context), so by default the widgets blend into your app automatically. Never hardcode colors or fonts in host code — set them here so the whole kit stays consistent.

PasskeySignInButton(
  backend: myBackend,
  theme: const PasskeyUiTheme(primaryColor: Colors.deepPurple, borderRadius: 12),
  onSuccess: (session) {},
)
Annotations

Constructors

PasskeyUiTheme({Color? primaryColor, Color? onPrimaryColor, Color? backgroundColor, double borderRadius = 12.0, double buttonHeight = 52.0, String? fontFamily, PasskeyIconStyle iconStyle = PasskeyIconStyle.outline, Brightness? brightness})
Creates a PasskeyUiTheme. Every field is optional and resolves against the ambient ThemeData when omitted.
const

Properties

backgroundColor → Color?
Surface color for full-screen flows. Defaults to colorScheme.surface.
final
borderRadius → double
Corner radius applied to buttons and cards.
final
brightness → Brightness?
Forces a light/dark variant. Defaults to the ambient theme's brightness.
final
buttonHeight → double
Height of primary action buttons.
final
fontFamily → String?
Optional font family override applied to this kit's text.
final
hashCode → int
The hash code for this object.
no setteroverride
iconStyle → PasskeyIconStyle
Whether biometric icons use outline or filled glyphs.
final
onPrimaryColor → Color?
Foreground color drawn on top of primaryColor. Defaults to colorScheme.onPrimary.
final
primaryColor → Color?
Primary/action color (buttons, accents). Defaults to colorScheme.primary.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shape → RoundedRectangleBorder
A ShapeBorder built from borderRadius, for buttons and cards.
no setter

Methods

backgroundColorOf(BuildContext context) → Color
The resolved background/surface color for context.
brightnessOf(BuildContext context) → Brightness
The resolved brightness for context.
copyWith({Color? primaryColor, Color? onPrimaryColor, Color? backgroundColor, double? borderRadius, double? buttonHeight, String? fontFamily, PasskeyIconStyle? iconStyle, Brightness? brightness}) → PasskeyUiTheme
Returns a copy of this theme with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPrimaryColorOf(BuildContext context) → Color
The resolved on-primary (foreground) color for context.
primaryColorOf(BuildContext context) → Color
The resolved primary color for context.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

resolve(PasskeyUiTheme? theme) → PasskeyUiTheme
Returns the theme attached to a widget, or a default instance.