number<T extends num> method
T
number<T extends num>({})
Implementation
T number<T extends num>({
/// Knob node key.
required String key,
/// Knob node description.
String? description,
/// Knob node initial value.
required T initial,
/// Knob node minimum value.
required T min,
/// Knob node maximum value.
required T max,
}) {
final knobProvider = KnobsProvider.of(this);
final storyProvider = StoryProvider.of(this);
final knobNode = knobProvider.knobStore.addStoryKnob(
storyProvider.story.key,
knobKey: key,
knobNode: KnobNodeNumber<T>(
key: key,
description: description,
min: min,
max: max,
value: initial,
),
);
return knobNode.value;
}