Storybook class
A collection of stories.
It generates Contents in navigation drawer based on stories names.
This example shows how to create a simple Storybook:
Widget build(BuildContext context) => Storybook(
children: [
Story(
name: 'Flat button',
child: MaterialButton(child: Text('Flat button'), onPressed: () {}),
),
Story(
name: 'Raised button',
child: RaisedButton(child: Text('Raised button'), onPressed: () {}),
),
Story(
name: 'Input field',
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Input field',
),
),
),
],
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Storybook
Constructors
-
Storybook({Key? key, List<
Story> children = const [], ThemeData? theme, ThemeData? darkTheme, ThemeMode themeMode = ThemeMode.system, List<LocalizationsDelegate> ? localizationDelegates, StoryWrapperBuilder? storyWrapperBuilder, Iterable<Plugin> ? plugins, String initialRoute = '/', TransitionBuilder? builder})
Properties
- builder → TransitionBuilder?
-
A builder for inserting widgets above the Navigator or - when the
WidgetsApp.router constructor is used - above the Router but below the
other widgets created by the WidgetsApp widget, or for replacing the
Navigator/Router entirely.
final
-
children
→ List<
Story> -
Stories in the storybook.
final
- darkTheme → ThemeData?
-
Theme override for the dark theme.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialRoute → String
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
localizationDelegates
→ List<
LocalizationsDelegate> ? -
Localizations Delegates override
final
-
The list of observers for the Navigator created for this app.
final
-
plugins
→ Iterable<
Plugin> -
Optional list of plugins.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storyWrapperBuilder → StoryWrapperBuilder?
-
Optional parameter to override story wrapper.
final
- theme → ThemeData?
-
Theme override for the light theme.
final
- themeMode → ThemeMode
-
Indicates theme mode to use: light, dark or system.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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