ThemeConfig class final

The theme properties (spring.flutter.theme.*) sorted into named themes: the shared part at the root, each theme of themes.<name> on top of it (or of the theme it extends), and which theme is active.

SpringThemes builds one from the properties and makes each theme from it; apps do not use it. Keys are kept relative to spring.flutter.theme and canonical (seed-color and seedColor both become seedcolor); list entries are indexed (typography.fontfamilyfallback.0) or one comma-separated value.

Constructors

ThemeConfig(Map<String, String> properties, {RemoteAddresses addresses = const RemoteAddresses(), ThemeDesigns designs = ThemeDesigns.none})
Sorts properties, whose keys are relative to spring.flutter.theme in any form (as a Binder gives them).

Properties

active ↔ String
The theme to show at the start, from active: system (the default) or a theme name.
getter/setter pair
addresses → RemoteAddresses
Reads the addresses of the themes (sources, images): the application's resolvers, then the built-in ones.
final
designs → ThemeDesigns
The designs the themes are read with: what makes a palette from a seed color and reads the properties of a design's own widgets.
final
hashCode → int
The hash code for this object.
no setterinherited
names → List<String>
The names of every theme: light and dark, then the others in alphabetical order (property sources, imported files included, have no meaningful order).
latefinal
remember ↔ bool
Whether the theme the user chooses is kept between runs, from remember; true by default.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
systemDark ↔ String
The theme system shows when the device is in dark mode, from system-dark; dark by default.
getter/setter pair
systemLight ↔ String
The theme system shows when the device is in light mode, from system-light; light by default.
getter/setter pair

Methods

nameOf(String name) → String?
The theme's name as first declared, for name in any case or with - and _; null when there is no such theme.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(String name) → Map<String, String>
The properties of theme name, each layer over the previous one: the brightness (dark for the dark theme, else light), the shared part or the theme it extends, then its own. A list in a later layer replaces the whole list. Then the references ($colors.primary) are replaced by the values they name, so an extending theme that changes colors.primary changes what refers to it. Throws an ArgumentError for an unknown name, a StateError for an extends cycle or unknown parent, and a ThemePropertyException for a reference cycle or an unknown reference.
toString() → String
A string representation of this object.
inherited

Operators

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