toNotifier<V> method
Generates a value notifier.
Whenever a value is updated, the value of the notifier is also updated.
The notifier is also closed when the ValueModel is dispose().
Implementation
ValueNotifier<V> toNotifier<V>(V Function(T value) converter) {
if (_valueNotifiers.containsKey(converter)) {
return _valueNotifiers[converter]! as ValueNotifier<V>;
}
return _valueNotifiers[converter] = ValueNotifier<V>(converter.call(value));
}