NmTokens class
Every size, color and style decision a widget needs, resolved for the active palette × style × density × brightness.
All sizes derive from iconUnit (16 logical px — the Fugue glyph box), so cards, rows and type keep the same proportion to icons on every display.
- Inheritance
-
- Object
- ThemeExtension<
NmTokens> - NmTokens
- Annotations
Constructors
- NmTokens({required NmColors colors, required NmStyle style, required NmDensity density, required NmIconography iconography, required NmFugueVariant fugueVariant, required NmBreakpoints breakpoints, required NmSizes sizes})
-
Creates an NmTokens.
const
- NmTokens.resolve({required NmColors colors, required NmStyle style, required NmDensity density, required NmIconography iconography, NmFugueVariant? fugueVariant, NmBreakpoints breakpoints = const NmBreakpoints()})
-
Builds tokens for the given axes.
factory
Properties
- breakpoints → NmBreakpoints
-
Form-factor widths.
final
- cardShadows → bool
-
Whether cards cast the soft shadow (light only).
no setter
- colors → NmColors
-
Resolved colors.
final
- density → NmDensity
-
Spacing and type scale.
final
- fugueVariant → NmFugueVariant
-
Fugue with or without shadows.
final
- gradientCta → bool
-
Whether primary CTAs use the accent gradient.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconography → NmIconography
-
Icon family.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizes → NmSizes
-
Resolved sizes.
final
- style → NmStyle
-
Visual style.
final
- text → NmTextStyles
-
Common text styles derived from these tokens.
no setter
- type → Object
-
The extension's type.
no setterinherited
- zebra → bool
-
Whether tables stripe rows.
no setter
Methods
-
copyWith(
{NmColors? colors, NmStyle? style, NmDensity? density, NmIconography? iconography, NmFugueVariant? fugueVariant, NmBreakpoints? breakpoints}) → NmTokens -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant ThemeExtension< NmTokens> ? other, double t) → NmTokens -
Linearly interpolate with another ThemeExtension object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
primaryFill(
double labelSize) → Color -
Solid fill for a primary button whose label is
labelSizepx in the flat styles (clean, technical); the expressive style uses the accent gradient instead (gradientCta). -
toString(
) → String -
A string representation of this object.
inherited
-
withDensity(
NmDensity d) → NmTokens -
Same tokens with a different density (for per-widget
denseopt-in).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → NmTokens - Tokens from the nearest theme; falls back to the default theme tokens.