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
valuesof themename;addressesreads 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; forcomponents,card,appbarand so on. -
color(
String path) → Color? -
The color at
path: a plain value (a name,#RRGGBB, ...) or an object{ color, mix: { with, amount }, alpha }, wheremixmoves the color towardswithbyamountand thenalphasets the opacity.nullwhen 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;nullwhen there is neither. -
colorObject(
String path) → Color -
The color object at
path, whose children arecolor(required),mixandalpha. -
list(
String path) → List< String> ? -
The list at
path: the indexed entries in order, else one comma-separated value split; empty items are dropped, andnullwhen 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, written12%or0.12. -
propertyName(
String path) → String -
The full name of the property at
pathas 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
pathparsed withparse;nullwhen there is none. Throws a ThemePropertyException naming the property andexpectedwhenparsecannot 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;nullwhen missing or empty.
Constants
- colorFormats → const String
- What a color may be written as, for error messages.