WidgetbookAddon<T> class abstract

Base class for all Widgetbook addons.

WidgetbookAddons are global configuration tools that affect all WidgetbookUseCases in your Widgetbook. Unlike Knobs, which operate at the individual use case level, addons provide cross-cutting functionality such as theming, localization, viewport simulation, and more.

Learn more:

Inheritance
Implementers
Annotations

Constructors

WidgetbookAddon({required String name, @Deprecated('Use local field instead') T? initialSetting})
Creates a WidgetbookAddon with the given name.

Properties

description String?
The description of the composable group.
finalinherited
fields List<Field>
A list of Fields that belong to this composable group.
no setterinherited
groupName String
The name of the query group param.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isNullable bool
Whether this composable group is nullable.
finalinherited
name String
The display name of the composable group.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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, T setting) Widget
Builds the wrapper widget for use cases based on the current setting.
isNullified(BuildContext context) bool
Whether the group has been nullified by toggleNullification.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
slugify(String name) String
Converts the name to a slugified version that can be used in query parameters.
inherited
toggleNullification(BuildContext context, {required bool nullify}) → void
Adds/removes Field.nullabilitySymbol to/from all fields depending on the nullify state. If nullify is true, the Field.nullabilitySymbol is added. If nullify is false, the Field.nullabilitySymbol is removed.
inherited
toJson() Map<String, dynamic>
Converts this composable group to a JSON representation.
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 query group using the FieldCodec.toValue from Field.codec.
inherited

Operators

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