KnobsBuilder class abstract
Provides helper methods for creating knobs: control elements that can be used in stories to dynamically update its properties.
It's injected into a story builder, so you can use it there:
Story(
name: 'Flat button',
builder: (_, k) => MaterialButton(
onPressed: k.boolean('Enabled', initial: true) ? () {} : null,
child: Text(k.text('Text', initial: 'Flat button')),
),
)
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
boolean(
String label, {bool initial = false}) → bool -
Creates checkbox with
label
andinitial
value. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
number(
String label, {num initial = 0}) → num -
options<
T> (String label, {T initial, List< Option< options = const []}) → TT> > -
Creates select field with
label
,initial
value and list ofoptions
. -
slider(
String label, {double initial = 0, double max = 1, double min = 0}) → double -
text(
String label, {String initial = ''}) → String -
Creates text input field with
label
andinitial
value. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited