Widgetbook<CustomTheme> class
Describes the configuration for your Widget library.
Widgetbook is the central element in organizing your widgets into Folders and UseCases. In addition, Widgetbook allows you to specify
- the Themes used by your application,
- the Devices on which you'd like to preview the catalogued widgets
- the Locales used by your application
Widgetbook defines the following constructors for different themes
- Widgetbook<
CustomTheme
> if you use aCustomTheme
for your app - Widgetbook.cupertino if you use CupertinoThemeData for your app
- Widgetbook.material if you use ThemeData for your app
Note: if you use for instance both CupertinoThemeData and ThemeData in
your app, use the Widgetbook<CustomTheme
> constructor with CustomTheme
set to dynamic
or Object and see ThemeBuilderFunction for how to
render custom themes.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Widgetbook
Constructors
-
Widgetbook({Key? key, required List<
WidgetbookCategory> categories, List<Device> ? devices, required AppInfo appInfo, List<LocalizationsDelegate> ? localizationsDelegates, required List<WidgetbookTheme< themes, DeviceFrameBuilderFunction? deviceFrameBuilder, LocalizationBuilderFunction? localizationBuilder, ThemeBuilderFunction<CustomTheme> >CustomTheme> ? themeBuilder, ScaffoldBuilderFunction? scaffoldBuilder, AppBuilderFunction appBuilder = defaultAppBuilder, UseCaseBuilderFunction? useCaseBuilder, List<Locale> ? supportedLocales, List<WidgetbookFrame> ? frames, List<double> ? textScaleFactors}) -
Creates a new instance of Widgetbook.
const
Properties
- appBuilder → AppBuilderFunction
-
final
- appInfo → AppInfo
-
Information about the app that is catalogued in the Widgetbook.
final
-
categories
→ List<
WidgetbookCategory> -
Categories which host Folders and WidgetElements.
This can be used to organize the structure of the Widgetbook on a large
scale.
final
- deviceFrameBuilder → DeviceFrameBuilderFunction?
-
final
-
devices
→ List<
Device> -
The devices on which Stories are previewed.
final
-
frames
→ List<
WidgetbookFrame> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- localizationBuilder → LocalizationBuilderFunction?
-
final
-
localizationsDelegates
→ List<
LocalizationsDelegate> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaffoldBuilder → ScaffoldBuilderFunction?
-
final
-
supportedLocales
→ List<
Locale> -
A list of supported
Locale
s.final -
textScaleFactors
→ List<
double> -
A list of text scale factors to test for font size accessibility
final
-
themeBuilder
→ ThemeBuilderFunction<
CustomTheme> ? -
final
-
themes
→ List<
WidgetbookTheme< CustomTheme> > -
final
- useCaseBuilder → UseCaseBuilderFunction?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Widgetbook< CustomTheme> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
cupertino(
{required List< WidgetbookCategory> categories, required List<WidgetbookTheme< themes, required AppInfo appInfo, List<CupertinoThemeData> >Device> ? devices, List<WidgetbookFrame> ? frames, List<Locale> ? supportedLocales, List<LocalizationsDelegate> ? localizationsDelegates, DeviceFrameBuilderFunction? deviceFrameBuilder, LocalizationBuilderFunction? localizationBuilder, ThemeBuilderFunction<CupertinoThemeData> ? themeBuilder, AppBuilderFunction? appBuilder, ScaffoldBuilderFunction? scaffoldBuilder, UseCaseBuilderFunction? useCaseBuilder, List<double> ? textScaleFactors, Key? key}) → Widgetbook<CupertinoThemeData> - A Widgetbook which uses cupertino theming via CupertinoThemeData.
-
material(
{required List< WidgetbookCategory> categories, required List<WidgetbookTheme< themes, required AppInfo appInfo, List<ThemeData> >Device> ? devices, List<WidgetbookFrame> ? frames, List<Locale> ? supportedLocales, List<LocalizationsDelegate> ? localizationsDelegates, DeviceFrameBuilderFunction? deviceFrameBuilder, LocalizationBuilderFunction? localizationBuilder, ThemeBuilderFunction<ThemeData> ? themeBuilder, AppBuilderFunction? appBuilder, ScaffoldBuilderFunction? scaffoldBuilder, UseCaseBuilderFunction? useCaseBuilder, List<double> ? textScaleFactors, Key? key}) → Widgetbook<ThemeData> - A Widgetbook which uses material theming via ThemeData.