value property

  1. @override
T get value

Gets the current value of the signal.

If read inside an active reactive context (e.g., an effect or computed signal), the calling context automatically subscribes to updates of this signal.

Implementation

@override
T get value {
  if (!isInitialized) {
    throw LazySignalInitializationError(this);
  }
  if (disposed) {
    if (kDebugMode) {
      print(
        'signal warning: [$globalId|$debugLabel] has been '
        'read after disposed: ${StackTrace.current}',
      );
    }
  }
  return super.value;
}
set value (T val)
inherited

Sets the current value of the signal.

If the new value is not equal to the existing value (based on equalityCheck), the signal's version is incremented and all active downstream subscribers (computeds/effects) are synchronously notified to re-evaluate.

Implementation

set value(T val) => set(val);