VyuhThemeExtension class final

Design tokens for the UI the framework draws itself.

Add it to your ThemeData.extensions to restyle loaders, error views and placeholders. Every token you leave out falls back to a value derived from the theme's ColorScheme, so the defaults follow light and dark mode.

ThemeData(
  colorSchemeSeed: brand,
  extensions: const [
    VyuhThemeExtension(showPoweredBy: false, loaderDelay: Duration(milliseconds: 300)),
  ],
)

Read the resolved tokens with VyuhThemeExtension.of.

Annotations

Constructors

VyuhThemeExtension({Color? appLoaderBackground, Color? loaderColor, Color? routeLoaderBackground, Color? placeholderBackground, Color? placeholderForeground, Color? failureBackground, Color? failureForeground, Color? debugBackground, Color? debugForeground, Color? debugBorder, double? radius, Duration? loaderDelay, bool? showPoweredBy, TextStyle? failureTitleStyle, TextStyle? failureMessageStyle, Map<FailureKind, IconData>? failureIcons, double? failureIconSize, double? failureMaxWidth})
const
VyuhThemeExtension.fallback(ColorScheme scheme)
Fully resolved tokens for scheme.
factory

Properties

appLoaderBackground → Color?
Background of the full-screen app loader.
final
debugBackground → Color?
Background of debug-only diagnostics.
final
debugBorder → Color?
Border color of debug-only diagnostics.
final
debugForeground → Color?
Text color of debug-only diagnostics.
final
failureBackground → Color?
Background of the badge behind failure icons and of inline failures.
final
failureForeground → Color?
Icon and text color on failureBackground.
final
failureIcons → Map<FailureKind, IconData>?
Icons for failure kinds. Kinds left out keep their default icon.
final
failureIconSize → double?
Size of the icon on full-page failures.
final
failureMaxWidth → double?
Maximum width of the content on full-page failures.
final
failureMessageStyle → TextStyle?
Text style of failure messages, merged over the theme's body style.
final
failureTitleStyle → TextStyle?
Text style of failure titles, merged over the theme's headline (pages) or title (inline cards) style.
final
hashCode → int
The hash code for this object.
no setterinherited
loaderColor → Color?
Progress color of loaders.
final
loaderDelay → Duration?
How long a route or content loader waits before it appears, so fast loads don't flash.
final
placeholderBackground → Color?
Background of image and content placeholders.
final
placeholderForeground → Color?
Icon color of placeholders.
final
radius → double?
Corner radius of inline failures, placeholders and diagnostics.
final
routeLoaderBackground → Color?
Background behind a route that is loading.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showPoweredBy → bool?
Whether the app loader shows "Powered by Vyuh".
final
type → Object
The extension's type.
no setterinherited

Methods

copyWith({Color? appLoaderBackground, Color? loaderColor, Color? routeLoaderBackground, Color? placeholderBackground, Color? placeholderForeground, Color? failureBackground, Color? failureForeground, Color? debugBackground, Color? debugForeground, Color? debugBorder, double? radius, Duration? loaderDelay, bool? showPoweredBy, TextStyle? failureTitleStyle, TextStyle? failureMessageStyle, Map<FailureKind, IconData>? failureIcons, double? failureIconSize, double? failureMaxWidth}) → VyuhThemeExtension
Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.
lerp(covariant VyuhThemeExtension? other, double t) → VyuhThemeExtension
Linearly interpolate with another ThemeExtension object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

of(BuildContext context) → VyuhThemeExtension
The tokens for context: the theme's extension, with every missing token filled from its color scheme.