value property Null safety

  1. @override
T value

Returns the last emitted value, failing if there is no value. See hasValue to determine whether value has already been set.

Throws ValueStreamError if this Stream has no value.


T get value {
  final value = _wrapper.value;
  if (isNotEmpty(value)) {
    return value as T;
  throw ValueStreamError.hasNoValue();
void value=(T newValue)

Set and emit the new value.


set value(T newValue) => add(newValue);