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 tospring.flutter.themein any form (as aBindergives 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:
lightanddark, 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;trueby default.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemDark ↔ String
-
The theme
systemshows when the device is in dark mode, fromsystem-dark;darkby default.getter/setter pair - systemLight ↔ String
-
The theme
systemshows when the device is in light mode, fromsystem-light;lightby default.getter/setter pair
Methods
-
nameOf(
String name) → String? -
The theme's name as first declared, for
namein any case or with-and_;nullwhen 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 (darkfor thedarktheme, elselight), 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 changescolors.primarychanges what refers to it. Throws anArgumentErrorfor an unknown name, aStateErrorfor anextendscycle or unknown parent, and aThemePropertyExceptionfor 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