valueNotifierToSignal<T> function
Signal<T>
valueNotifierToSignal<T>(
- ValueNotifier<
T> valueNotifier, { - String? debugLabel,
- bool autoDispose = false,
A global helper function to convert a Flutter ValueNotifier to a mutable Signal.
Updates to either the notifier or the returned signal will automatically update the other.
This helper is a functional equivalent of the toSignal() extension method.
Example
final textControllerValue = ValueNotifier('');
final textSignal = valueNotifierToSignal(textControllerValue);
Implementation
Signal<T> valueNotifierToSignal<T>(
ValueNotifier<T> valueNotifier, {
String? debugLabel,
bool autoDispose = false,
}) {
return valueNotifier.toSignal(
debugLabel: debugLabel,
autoDispose: autoDispose,
);
}