ThemeAddon<T> class
A WidgetbookAddon for changing the active custom theme.
A themeBuilder must be provided that returns an InheritedWidget or similar Widgets.
The initialTheme is the first theme used when the app is started. If
provided, it must be within themes. Otherwise, when initialTheme is null
,
the first theme in themes is used.
- Inheritance
-
- Object
- FieldsComposable<
WidgetbookTheme< T> > - WidgetbookAddon<
WidgetbookTheme< T> > - ThemeAddon
- Implementers
Constructors
-
ThemeAddon({required List<
WidgetbookTheme< themes, WidgetbookTheme<T> >T> ? initialTheme, required ThemeBuilder<T> themeBuilder})
Properties
-
fields
→ List<
Field> -
no setteroverride
- groupName → String
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialSetting
→ WidgetbookTheme<
T> ? -
finalinherited
-
initialTheme
→ WidgetbookTheme<
T> ? -
final
- name → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
themeBuilder
→ ThemeBuilder<
T> -
final
-
themes
→ List<
WidgetbookTheme< T> > -
final
Methods
-
buildFields(
BuildContext context) → Widget -
Converts the fields into a Widget that will be rendered in the
settings side panel.
inherited
-
buildUseCase(
BuildContext context, Widget child, WidgetbookTheme< T> setting) → Widget -
Wraps use cases with a custom widget depending on the addon
setting
that is obtained from valueFromQueryGroup.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
slugify(
String name) → String -
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
valueFromQueryGroup(
Map< String, String> group) → WidgetbookTheme<T> -
Converts a query group to a value of type
T
.override -
valueOf<
TField> (String name, Map< String, String> group) → TField? -
Decodes the value of the Field with
name
from the querygroup
using the FieldCodec.toValue from Field.codec.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited