AppThemeExtension class
Theme extension carrying design-system specific tokens.
Register on a ThemeData via extensions: [AppThemeExtension(...)]. Use
Theme.of(context).extension<AppThemeExtension>() to read it back.
- Inheritance
-
- Object
- ThemeExtension<
AppThemeExtension> - AppThemeExtension
Constructors
- AppThemeExtension({Color? primary, Color? secondary, Color? success, Color? error, Color? warning, Color? info, Gradient? brandGradient, Color? surface, AppBarStyle appBarStyle = AppBarStyle.solid})
-
const
Properties
- appBar → AppBarColors
-
AppBar colors resolved from the current appBarStyle.
no setter
- appBarStyle → AppBarStyle
-
AppBar visual style.
final
- brandGradient → Gradient?
-
Brand gradient override.
final
- error → Color?
-
Error color.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- info → Color?
-
Info color.
final
- primary → Color?
-
Brand primary color override.
final
- resolvedError → Color
-
Resolved error.
no setter
- resolvedGradient → Gradient
-
Resolved gradient.
no setter
- resolvedInfo → Color
-
Resolved info.
no setter
- resolvedPrimary → Color
-
Resolved brand primary.
no setter
- resolvedSecondary → Color
-
Resolved brand secondary.
no setter
- resolvedSuccess → Color
-
Resolved success.
no setter
- resolvedWarning → Color
-
Resolved warning.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondary → Color?
-
Brand secondary color override.
final
- success → Color?
-
Success color.
final
- surface → Color?
-
Base surface color.
final
- type → Object
-
The extension's type.
no setterinherited
- warning → Color?
-
Warning color.
final
Methods
-
copyWith(
{Color? primary, Color? secondary, Color? success, Color? error, Color? warning, Color? info, Gradient? brandGradient, Color? surface, AppBarStyle? appBarStyle}) → AppThemeExtension -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant AppThemeExtension? other, double t) → AppThemeExtension -
Linearly interpolate with another ThemeExtension object.
override
-
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
-
defaults(
Brightness brightness) → AppThemeExtension -
Builds default tokens for a
brightness. -
of(
BuildContext context) → AppThemeExtension - Reads the registered extension, falling back to theme defaults.