WidgetbookAddon<T> class
abstract
WidgetbookAddons are like global Knobs, they change the state for all WidgetbookUseCases. For example, you can manipulate the theme for all WidgetbookUseCases, instead of doing it one-by-one using Knobs.
See also:
- ThemeAddon, changes the active custom theme.
- MaterialThemeAddon, changes the active ThemeData.
- CupertinoThemeAddon, changes the active CupertinoThemeData.
- TextScaleAddon, changes the active text scale.
- LocalizationAddon, changes the active Locale.
- DeviceFrameAddon, an WidgetbookAddon to change the active frame that allows to view the WidgetbookUseCase on different screens.
- Inheritance
-
- Object
- FieldsComposable<
T> - WidgetbookAddon
- Implementers
- Annotations
Constructors
- WidgetbookAddon({required String name, @Deprecated('Use local field instead') T? initialSetting})
Properties
Methods
-
buildFields(
BuildContext context) → Widget -
Converts the fields into a Widget that will be rendered in the
settings side panel.
override
-
buildUseCase(
BuildContext context, Widget child, T setting) → Widget -
Wraps use cases with a custom widget depending on the addon
setting
that is obtained from valueFromQueryGroup. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
slugify(
String name) → String -
inherited
-
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
valueFromQueryGroup(
Map< String, String> group) → T -
Converts a query group to a value of type
T
.inherited -
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