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);nullotherwise. -
boolean(
String value) → bool? -
trueorfalse, in any case;nullotherwise. -
canonical(
String name) → String -
A key or name in its canonical form: lower case, without
-and_, soseed-color,seedColorandSEED_COLORare the same key. -
color(
String value) → Color? -
A plain color from a
Colorsname (deepPurple,deepPurple.shade200,black54,white,black,transparent) or from#RGB,#RRGGBB,#AARRGGBB;nullotherwise. A color changed bymixoralphais an object, read byThemeProperties.color. -
curve(
String value) → Cubic? -
A curve from four numbers,
0.2, 0, 0, 1: a cubic Bézier curve, like CSScubic-bezier;nullotherwise. -
duration(
String value) → Duration? -
A duration from
250ms,250 ms,4s,1.5s,2m,1h,0.5d(unitsms,s,m,h,d, in any case; decimals allowed), or plain milliseconds;nullotherwise. The one duration syntax of the theme: motion, animations, styles, tokens,transition,refreshandtimeout. -
enumValue<
T extends Enum> (List< T> values, String value) → T? -
The one of
valueswhose name matchesvalue, ignoring case,-and_(tonal-spotgivestonalSpot);nullwhen 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, elsetext. The fixturetest/fixtures/theme_value_kinds.yamlis the truth of it; the generator mirrors the same rules. -
number(
String value) → double? -
A number (
12,-3,+5,.5,1.5,1e3,Infinity);nullotherwise. Hex (0x10) andNaNare 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);nullwhenvalueis no list of at least two numbers. -
percent(
String value) → double? -
A share from
0%to100%or from0to1, as a number from 0 to 1 (12%and0.12are the same);nullotherwise. -
weight(
String value) → FontWeight? -
A font weight from
100…900, orthin,extra-light,light,normal/regular,medium,semibold,bold,extra-bold,black;nullotherwise.
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.