useValueNotifier<T> function
Creates a ValueNotifier that is automatically disposed.
As opposed to useState
, this hook does not subscribe 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,
),
);
}