useValueNotifier<T> function Null safety

ValueNotifier<T> useValueNotifier<T>(
  1. T initialData,
  2. [List<Object?>? keys]
)

Creates a ValueNotifier automatically disposed.

As opposed to useState, this hook do not subscribes to ValueNotifier. This allows a more granular rebuild.

See also:

Implementation

ValueNotifier<T> useValueNotifier<T>(T initialData, [List<Object?>? keys]) {
  return use(
    _ValueNotifierHook(
      initialData: initialData,
      keys: keys,
    ),
  );
}