value property

T get value

Getter:

Return the value of the underlying object.

The value used inside the consume widget will cause the widget to rebuild when updating; or use

watchedVar.consume(() => widget)

to touch() the watched variable itself first and then globalConsume(() => widget).

Implementation

T get value {
  // if rx automatic aspect is enabled. (precede over state rx aspect)
  if (stateRxAutoAspectFlag == true) {
    touch(); // Touch to activate rx automatic aspect management.
    //
  } else if (stateWidgetAspectsFlag == true) {
    if (stateWidgetAspects != null) {
      rxAspects.addAll(stateWidgetAspects!);
    } else {
      _isNullBroadcast = true;
    }
  }

  return _value;
}
set value (T value)

Setter:

Set the value of the underlying object.

Update to the value will notify the host to rebuild; or the underlying object would be a class, then use

watchedVar.ob.updateMethod(...) to notify the host to rebuild.

watchedVar.ob = watchedVar.notify() and then return the underlying object

Implementation

set value(T value) {
  if (_value != value) {
    _value = value;
    publishRxAspects();
    _keepPersist();
  }
}