value property Null safety

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 wrapper = _wrapper.value;
  if (wrapper != null) {
    return wrapper.value;
  throw ValueStreamError.hasNoValue();
void value=(T newValue)

Set and emit the new value.


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