ThemeValues class abstract final

Parses the text values of theme properties: colors, weights, numbers, durations, curves, booleans and enum names. Each parser returns null for a value it cannot read, and the caller reports it as a ThemePropertyException. Internal to the starter.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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

Static Properties

curveNames → List<String>
The names anyCurve knows, in kebab case.
no setter

Static Methods

anyCurve(String value) → Curve?
A curve: a name (linear, ease, ease-in, ease-out, ease-in-out, fast-out-slow-in, decelerate, standard, emphasized, bounce-out, ... see curveNames) or four numbers (curve); null otherwise.
boolean(String value) → bool?
true or false, in any case; null otherwise.
canonical(String name) → String
A key or name in its canonical form: lower case, without - and _, so seed-color, seedColor and SEED_COLOR are the same key.
color(String value) → Color?
A plain color from a Colors name (deepPurple, deepPurple.shade200, black54, white, black, transparent) or from #RGB, #RRGGBB, #AARRGGBB; null otherwise. A color changed by mix or alpha is an object, read by ThemeProperties.color.
curve(String value) → Cubic?
A curve from four numbers, 0.2, 0, 0, 1: a cubic Bézier curve, like CSS cubic-bezier; null otherwise.
duration(String value) → Duration?
A duration from 250ms, 250 ms, 4s, 1.5s, 2m, 1h, 0.5d (units ms, s, m, h, d, in any case; decimals allowed), or plain milliseconds; null otherwise. The one duration syntax of the theme: motion, animations, styles, tokens, transition, refresh and timeout.
enumValue<T extends Enum>(List<T> values, String value) → T?
The one of values whose name matches value, ignoring case, - and _ (tonal-spot gives tonalSpot); null when none does.
kindOf(String value) → String
How a theme value reads, by what it looks like: number, duration (a number with a unit), insets (a comma separated list of numbers), color, else text. The fixture test/fixtures/theme_value_kinds.yaml is the truth of it; the generator mirrors the same rules.
number(String value) → double?
A number (12, -3, +5, .5, 1.5, 1e3, Infinity); null otherwise. Hex (0x10) and NaN are no numbers.
numberList(String value) → List<double>?
The numbers of insets written as a comma separated list (12, 6, two or four of them are valid insets); null when value is no list of at least two numbers.
percent(String value) → double?
A share from 0% to 100% or from 0 to 1, as a number from 0 to 1 (12% and 0.12 are the same); null otherwise.
weight(String value) → FontWeight?
A font weight from 100 … 900, or thin, extra-light, light, normal / regular, medium, semibold, bold, extra-bold, black; null otherwise.

Constants

standardEasing → const Curve
Material 3's standard easing, the curve of a motion the theme names none for. The Material 3 easings are numbers here, so a theme has them without the Material library.