boolean method

bool boolean({
  1. required String key,
  2. String? description,
  3. required bool initial,
})

Creates bool knob.

Implementation

bool boolean({
  /// Knob node key.
  required String key,
  /// Knob node description.
  String? description,
  /// Knob node initial value.
  required bool initial,
}) {
  final knobProvider = KnobsProvider.of(this);
  final storyProvider = StoryProvider.of(this);

  final knobNode = knobProvider.knobStore.addStoryKnob(
    storyProvider.story.key,
    knobKey: key,
    knobNode: KnobNodeBool(
      key: key,
      description: description,
      value: initial,
    ),
  );

  return knobNode.value;
}