ThemeRegistry<T> class

A registry of named themes (each theme has a light/dark ThemePair).

The key type T can be anything stable and comparable, such as:

  • an enum (AppThemeId.ocean)
  • a string ('ocean')
Annotations

Constructors

ThemeRegistry({required Map<T, ThemePair> themes, required T initialTheme})
Creates a registry with themes and an initialTheme.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
initialTheme → T
The default theme id used at startup.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
themes Map<T, ThemePair>
All available themes.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pairOf(T id) ThemePair
Returns the ThemePair for the given theme id.
toString() String
A string representation of this object.
inherited

Operators

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