AstryxDefineThemeInput class
The input to defineTheme.
{@tool snippet}
final myTheme = defineTheme(
const AstryxDefineThemeInput(
name: 'my-brand',
color: AstryxColorScaleConfig(accent: '#0064E0'),
typography: AstryxTypographyConfig(
scale: AstryxTypeScaleSpec(base: 14, ratio: 1.2),
),
tokens: <String, AstryxTokenValue>{
'--radius-element': AstryxTokenValue('6px'),
},
),
);
{@end-tool}
- Annotations
Constructors
-
AstryxDefineThemeInput({required String name, AstryxDefinedTheme? extendsTheme, AstryxTypographyConfig? typography, AstryxMotionScaleConfig? motion, AstryxRadiusScaleConfig? radius, AstryxColorScaleConfig? color, Map<
String, AstryxTokenValue> ? tokens, AstryxComponentStyleMap? components, Map<String, Object> ? icons, AstryxSyntaxTheme? syntax, AstryxOnMediaOverrides? onDark, AstryxOnMediaOverrides? onLight}) -
Creates a theme definition input.
const
Properties
- color → AstryxColorScaleConfig?
-
Colour: a seed accent, neutral warmth and contrast level.
final
- components → AstryxComponentStyleMap?
-
Component style overrides, keyed by lowercase component name.
final
- extendsTheme → AstryxDefinedTheme?
-
A base theme to extend.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
icons
→ Map<
String, Object> ? -
The icon registry, keyed by semantic icon name.
final
- motion → AstryxMotionScaleConfig?
-
Motion: base durations and a scaling ratio.
final
- name → String
-
The theme name, used to identify and register the theme.
final
- onDark → AstryxOnMediaOverrides?
-
Overrides for content on a dark surface — an inverted toast, a dark
tooltip. The defaults apply when this is omitted.
final
- onLight → AstryxOnMediaOverrides?
-
Overrides for content on a light surface, such as a light popover on a
dark page.
final
- radius → AstryxRadiusScaleConfig?
-
Radius: a base unit and a multiplier.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- syntax → AstryxSyntaxTheme?
-
The default syntax highlighting theme for code components.
final
-
tokens
→ Map<
String, AstryxTokenValue> ? -
Explicit token overrides, keyed by CSS custom property name.
final
- typography → AstryxTypographyConfig?
-
Typography: the type scale, plus fonts and weights per role.
final
Methods
-
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