ThemeCollection class
A collection of theme ID/ThemeData pairs, from which you retrieve a ThemeData using its associated theme ID.
Constructors
-
ThemeCollection({Map<
int, ThemeData> ? themes, ThemeData? fallbackTheme}) - Creates a new ThemeCollection.
Properties
- fallbackTheme → ThemeData
-
The fallback theme.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addTheme(
int themeId, ThemeData theme) → void -
Associates the
themeId
with the giventheme
. -
hasThemeForId(
int themeId) → bool -
Returns true if this ThemeCollection has sepcific ThemeData stored for the given
themeId
. If this returns false, retrieving the ThemeData forthemeId
yields the fallbackTheme specified in the constructor. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int themeId) → ThemeData -
Returns the ThemeData for the given
themeId
or the fallbackTheme specified in the constructor ifthemeId
is not registered in the collection. -
operator []=(
int themeId, ThemeData theme) → void -
Associates the
themeId
with the giventheme
.