useValueNotifier<T> function

ValueNotifier<T> useValueNotifier<T>(
  1. T value
)

Creates a ValueNotifier.

The notifier is automatically disposed when the widget is unmounted.

Implementation

ValueNotifier<T> useValueNotifier<T>(T value) {
  final n = ValueNotifier<T>(value);
  onBeforeUnmount(n.dispose);
  return n;
}