widgetbook library

Widgetbook is a package to build widgets in isolation, test them in different states, and catalogue all your widgets in a single place.

Classes

AlignmentAddon
A WidgetbookAddon for testing widget alignment within its container.
AndroidViewports
A collection of predefined Android viewports.
BooleanField
Field that builds Switch for bool values.
BuilderAddon
A WidgetbookAddon for applying custom widget transformations to use cases.
ColorField
Field that builds ColorPicker for Color values using the ColorSpace to determine which format the Color is.
CupertinoThemeAddon
A ThemeAddon for changing the active CupertinoThemeData via CupertinoTheme.
DateTimeField
A Field that builds a TextFormField for DateTime values, allowing users to select a date and time using a date and time picker.
DeviceInfo
Info about a device and its frame.
Devices
A list of common device specifications sorted by target platform.
DoubleInputField
A Field that builds TextFormField for double values.
DoubleKnobsBuilder
A KnobsBuilder for double knobs.
DoubleOrNullKnobsBuilder
Same as DoubleKnobsBuilder but allows the knob to hold a null value.
DoubleSliderField
A Field that builds Slider for double values.
DurationField
A Field that represents a Duration value.
Field<T>
Base class for all input fields in Widgetbook.
FieldCodec<T>
A codec for encoding and decoding field values to and from query parameters.
FieldsComposable<T>
A FieldsComposable is a collection or a group of Fields that can be used to create a settings panel in Widgetbook. Each field in the group should have a unique name and can be used to configure addons or knobs.
GridAddon
A WidgetbookAddon for overlaying alignment grids on use cases.
InspectorAddon
A WidgetbookAddon for enabling widget inspection and debugging tools.
IntInputField
A Field that builds TextFormField for int values.
IntKnobsBuilder
A KnobsBuilder for integer knobs.
IntOrNullKnobsBuilder
Same as IntKnobsBuilder but allows the knob to hold a null value.
IntSliderField
A Field that builds Slider for int values.
IosViewports
A collection of predefined iOS viewports.
IterableSegmentedField<T>
A Field that builds SegmentedButton<Iterable<T>> for Iterable values.
Knob<T>
Base class for interactive controls that allow dynamic parameter adjustment.
KnobsBuilder
The builder is used to create and register a variety of knobs that can be used in your use-cases.
KnobsRegistry
The KnobsRegistry is a registry for Knobs that allows you to register and retrieve knobs by their label. After all knobs are registered, the lock method should be called, which will trigger the onLock callback.
LinuxViewports
A collection of predefined Linux viewports.
LocalizationAddon
A WidgetbookAddon for switching between different locales.
MacosViewports
A collection of predefined macOS viewports.
MaterialThemeAddon
A ThemeAddon for changing the active ThemeData via Theme.
ObjectDropdownField<T>
A Field that builds DropdownMenu<T> for Object values.
ObjectKnobsBuilder
A KnobsBuilder for object knobs.
ObjectOrNullKnobsBuilder
Same as ObjectKnobsBuilder but allows the knob to hold a null value.
ObjectSegmentedField<T>
A Field that builds SegmentedButton<T> for Object values.
SemanticsAddon
A WidgetbookAddon that provides a minimal semantics debugger.
StringField
A Field that builds TextFormField for String values.
TextScaleAddon
A WidgetbookAddon for scaling text content to test accessibility and responsive typography.
ThemeAddon<T>
A WidgetbookAddon for switching between different custom theme configurations.
TimeDilationAddon
A WidgetbookAddon for controlling Flutter animation timing and speed.
ViewportAddon
A WidgetbookAddon that allows switching between different viewports.
ViewportAddonConfig
AddonConfig for the ViewportAddon.
ViewportData
Data class representing a viewport configuration.
Viewports
A collection of all predefined viewports across platforms.
Widgetbook
Describes the configuration for your Widget library.
WidgetbookAddon<T>
Base class for all Widgetbook addons.
WidgetbookCategory
A navigation node that represents a category in the widget library.
WidgetbookCloudIntegration
Integration for Widgetbook Cloud, that is used to sync addons and knobs information with the host.
WidgetbookComponent
A navigation node that represents a component in the widget library.
WidgetbookFolder
A navigation node that represents a folder in the widget library.
WidgetbookIntegration
Integrations are like lifecycle hooks that notifies implementer about WidgetbookState changes.
WidgetbookLeafComponent
A special WidgetbookComponent with a single WidgetbookUseCase.
WidgetbookNode
A base class for all nodes in the navigation tree. The nodes have the following hierarchy:
WidgetbookPackage
A navigation node that represents a package in the widget library.
WidgetbookRoot
The root of all WidgetbookNodes.
WidgetbookScope
The WidgetbookScope is an InheritedNotifier that provides access to the WidgetbookState to its descendants.
WidgetbookState
Central state management for the Widgetbook application.
WidgetbookTheme<T>
A class representing a theme in Widgetbook.
WidgetbookUseCase
A navigation node that represents a specific use case of a widget.
WindowsViewports
A collection of predefined Windows viewports.
ZoomAddon
A WidgetbookAddon for zoom/scaling the widget tree.

Enums

ColorSpace
Represents the different color space formats that can be used for color representation and conversion.
FieldType
Defines the available field types that can be used in Widgetbook for creating interactive controls in the UI.
LayoutPanel
Represents the main sections of the Widgetbook layout.

Extensions

KnobsExtension on BuildContext
Extension on BuildContext that provides access to knobs functionality.

Typedefs

AppBuilder = Widget Function(BuildContext context, Widget child)
Function signature for building the app wrapper around use cases.
ThemeBuilder<T> = Widget Function(BuildContext context, T theme, Widget child)
Function signature for building themed widgets.