ThemeSpec class final

A complete theme (spec §5.1). Immutable; == compares every field; hashCode is stableHash, identical on every run and platform.

Annotations

Constructors

ThemeSpec({required int seed, required ThemeFamily family, required int engineVersion, required ThemeBrightness brightness, required Palette palette, required KeyShapeSpec keyShape, required KeyStyleSpec keyStyle, required TypeSpec type, required BackgroundSpec background, required MotionSpec motion, required SoundPackId sound, required String name, ThemeVariant variant = ThemeVariant.generated, int? heroId, int? seedHueTenths, ThemeIntent? intent, bool intentCentred = false, bool accessible = false, EffectsSpec effects = EffectsSpec.none, OperatorCue nonColourOperatorCue = OperatorCue.none})
const
ThemeSpec.fromJson(Object? json)
factory
ThemeSpec.fromJsonString(String source)
Parses source produced by toJsonString.
factory

Properties

accessible → bool
Generated under the Accessible lock (labels ≥ 7:1, rims ≥ 3:1).
final
background → BackgroundSpec
final
brightness → ThemeBrightness
final
effects → EffectsSpec
final
engineVersion → int
Generator version that produced this theme (share codes carry it).
final
family → ThemeFamily
final
hashCode → int
The hash code for this object.
no setteroverride
heroId → int?
Hero id when variant is ThemeVariant.hero.
final
intent → ThemeIntent?
The steering intent of a ThemeVariant.steered theme (without its families and name: the name is name); null otherwise. Serialised only when set, like seedHueTenths.
final
intentCentred → bool
Whether a steered theme was generated centred (the first theme of a steered feed: every narrowed choice at the middle of its range).
final
isDark → bool
Whether this is a dark theme.
no setter
keyShape → KeyShapeSpec
final
keyStyle → KeyStyleSpec
final
motion → MotionSpec
final
name → String
Generated name, e.g. "Mango Midnight".
final
nonColourOperatorCue → OperatorCue
The non-colour cue the family supplies for operator / = keys, if the guardrail relies on it (spec §5.4).
final
palette → Palette
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
seed → int
32-bit unsigned seed.
final
seedHueTenths → int?
The base hue (tenths of a degree) that replaced the palette draw, for the ThemeVariant.wallpaper variant ("Match my wallpaper"); null otherwise. Serialised only when set, so every other theme's canonical JSON and stable hash are unchanged.
final
sound → SoundPackId
Default sound pack (a user-pinned pack overrides it at runtime and is not part of the theme).
final
stableHash → int
FNV-1a-32 over the UTF-8 bytes of toJsonString: identical on every run and platform (unlike Object.hash, which is seeded per process).
no setter
type → TypeSpec
final
variant → ThemeVariant
final

Methods

copyWith({int? seed, ThemeFamily? family, int? engineVersion, ThemeVariant? variant, int? heroId, int? seedHueTenths, ThemeIntent? intent, bool? intentCentred, ThemeBrightness? brightness, bool? accessible, Palette? palette, KeyShapeSpec? keyShape, KeyStyleSpec? keyStyle, TypeSpec? type, BackgroundSpec? background, MotionSpec? motion, EffectsSpec? effects, SoundPackId? sound, String? name, OperatorCue? nonColourOperatorCue}) → ThemeSpec
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Canonical JSON (fixed key order, colours as aarrggbb).
toJsonString() → String
toJson encoded as a compact string (byte-identical everywhere).
toString() → String
A string representation of this object.
override

Operators

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

Constants

jsonFormat → const int
Version of the JSON layout (not the generator; see engineVersion).