value property

  1. @override
T get value
override

The current value of this Ref.

When accessed, it registers itself as a dependency for any active watcher.

Implementation

@override
T get value {
  getCurrentWatcher()?.addDepend(this);
  return _value;
}
set value (T newValue)

Updates the current value and triggers a notification.

If the new value is the same as the current value, no notification is sent.

Implementation

set value(T newValue) {
  if (_value == newValue) {
    return;
  }
  _value = newValue;
  _onChange();
}