widgetbook2 library

Classes

AppInfo
Apple
Collection of Apple devices
Desktop
Collection of all general desktops
Device
A virtual device that will rendered when a story is previewed
DeviceFrame
Simulate a physical device and embedding a virtual screen into it.
DeviceFrameStyle
The device frame style only allows to update the keyboardStyle for now.
DeviceFrameTheme
The theme gives a style to all its descentant device frames.
DeviceIdentifier
A unique identifier that represents a device.
DeviceInfo
Info about a device and its frame.
DeviceKeyboardStyle
The keyboard style allows to customize the virtual onscreen keyboard visuals.
Devices
A list of common device specifications sorted by target platform.
DeviceSize
Defines the size of a device
ExpandableOrganizer
ExpandableOrganizer is an abstract model which can host WidgetElements and/or Folders
GenericDesktopMonitorFramePainter
GenericLaptopFramePainter
GenericPhoneFramePainter
GenericTabletFramePainter
Knob<T>
This allows stories to have dynamically adjustable parameters.
KnobsNotifier
Updates listeners on changes with the knobs
KnobWrapper
Provides the description to the Knob
Option<T>
Data object that is used within the options knob
Organizer
Organizer is an abstract model which helps to structure Categories, WidgetElements and Stories in the folder tree.
Resolution
The resolution of a device defined by the nativeSize of the Device and its scaling factor.
Samsung
Collection of Samsung devices
VirtualKeyboard
Display a simulated on screen keyboard at the bottom of a child widget.
Widgetbook<CustomTheme>
Describes the configuration for your Widget library.
WidgetbookCategory
Categories help to organize WidgetElements and Stories into different areas.
WidgetbookComponent
WidgetbookDeviceFrame
WidgetbookFolder
A folder in the folder tree.
WidgetbookFrame
Declares a frame for a phone displaying its characteristics.
WidgetbookTheme<CustomTheme>
WidgetbookUseCase
UseCases represent a specific configuration of a widget and can be used to check edge cases of a Widget.

Enums

DeviceType
Category of different device types.

Functions

buildGenericDesktopMonitorDevice({required TargetPlatform platform, required String id, required String name, required Size screenSize, required Rect windowPosition, EdgeInsets safeAreas = EdgeInsets.zero, double pixelRatio = 2.0, EdgeInsets? rotatedSafeAreas, GenericDesktopMonitorFramePainter? framePainter}) DeviceInfo
Creates a generic desktop monitor device definition for the given name, target platform and screenSize. The windowPosition defines the position of a virtual window with a window frame adapted for the given platform.
buildGenericLaptopDevice({required TargetPlatform platform, required String id, required String name, required Size screenSize, required Rect windowPosition, EdgeInsets safeAreas = EdgeInsets.zero, double pixelRatio = 2.0, EdgeInsets? rotatedSafeAreas, GenericLaptopFramePainter? framePainter}) DeviceInfo
Creates a generic laptop device definition.
buildGenericPhoneDevice({required TargetPlatform platform, required String id, required String name, required Size screenSize, EdgeInsets safeAreas = EdgeInsets.zero, EdgeInsets rotatedSafeAreas = EdgeInsets.zero, double pixelRatio = 2.0, GenericPhoneFramePainter framePainter = const GenericPhoneFramePainter()}) DeviceInfo
Creates a generic phone device definition.
buildGenericTabletDevice({required TargetPlatform platform, required String id, required String name, required Size screenSize, EdgeInsets safeAreas = EdgeInsets.zero, EdgeInsets rotatedSafeAreas = EdgeInsets.zero, double pixelRatio = 2.0, GenericTabletFramePainter framePainter = const GenericTabletFramePainter()}) DeviceInfo
Creates a generic tablet device definition.
defaultThemeBuilder<CustomTheme>() ThemeBuilderFunction<CustomTheme>
getRouter(Widget child) → GoRouter
mapDeviceToDeviceInfo(Device device) DeviceInfo

Typedefs

AppBuilderFunction = Widget Function(BuildContext context, Widget child)
DeviceFrameBuilderFunction = Widget Function(BuildContext context, Device device, WidgetbookFrame frame, Orientation orientation, Widget child)
LocalizationBuilderFunction = Widget Function(BuildContext context, List<Locale> supportedLocales, List<LocalizationsDelegate>? localizationsDelegates, Locale activeLocale, Widget child)
ScaffoldBuilderFunction = Widget Function(BuildContext context, WidgetbookFrame frame, Widget child)
ThemeBuilderFunction<CustomTheme> = Widget Function(BuildContext context, CustomTheme theme, Widget child)
UseCaseBuilderFunction = Widget Function(BuildContext context, Widget child)