toNotifierSignal method

Signal<T> toNotifierSignal({
  1. JoltDebugOption? debug,
})

Converts this ValueNotifier to a Signal with bidirectional sync.

Changes to either ValueNotifier or Signal are synchronized.

Parameters:

  • debug: Optional debug options

Returns: A Signal synchronized with this ValueNotifier

Example:

final notifier = ValueNotifier(0);
final signal = notifier.toNotifierSignal();
notifier.value = 1; // signal.value becomes 1
signal.value = 2;   // notifier.value becomes 2

Implementation

Signal<T> toNotifierSignal({JoltDebugOption? debug}) {
  return ValueNotifierSignal.from(this, debug: debug);
}