ThemeProperties class final

The resolved properties of one theme, with the helpers that read them: values by path, lists, child keys, parsed values, and the full property name for error messages. Internal to the starter.

Constructors

ThemeProperties(String name, Map<String, String> values, {RemoteAddresses addresses = const RemoteAddresses()})
The resolved values of theme name; addresses reads its addresses (images).

Properties

addresses → RemoteAddresses
Reads the addresses of the theme (an image's source).
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The theme's name, used in error messages.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
values → Map<String, String>
The values by canonical path relative to the theme (components.card.shape).
final

Methods

children(String path) → Set<String>
The names directly below path; for components, card, appbar and so on.
color(String path) → Color?
The color at path: a plain value (a name, #RRGGBB, ...) or an object { color, mix: { with, amount }, alpha }, where mix moves the color towards with by amount and then alpha sets the opacity. null when there is neither. Throws a ThemePropertyException for anything else, an unknown key included.
colorList(String path) → List<Color>?
The colors of the list at path: indexed entries (each a color or an object) or one comma-separated value; null when there is neither.
colorObject(String path) → Color
The color object at path, whose children are color (required), mix and alpha.
list(String path) → List<String>?
The list at path: the indexed entries in order, else one comma-separated value split; empty items are dropped, and null when there is neither.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
percent(String path) → double?
The share (0 to 1) at path, written 12% or 0.12.
propertyName(String path) → String
The full name of the property at path as written in files, for error messages; the shared part's properties also name the theme.
read<T>(String path, T? parse(String value), String expected) → T?
The value at path parsed with parse; null when there is none. Throws a ThemePropertyException naming the property and expected when parse cannot read it.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](String path) → String?
The trimmed value at the canonical path; null when missing or empty.

Constants

colorFormats → const String
What a color may be written as, for error messages.