updateStoryKnobValue<T> method

void updateStoryKnobValue<T>(
  1. String storyKey, {
  2. required String knobKey,
  3. required T newValue,
})

Updates knob by knobKey in story by storyKey.

Implementation

void updateStoryKnobValue<T>(
  /// Key of the [Story].
  String storyKey, {

  /// Knob node key.
  required String knobKey,

  /// Knob node new value.
  required T newValue,
}) {
  final updatedKnob = _value[storyKey]![knobKey]!.copyWithValue(
    value: newValue,
  );

  _value = Map.of(_value)..[storyKey]![knobKey] = updatedKnob;

  notifyListeners();
}