value property

  1. @override
T get value
override

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.

See also valueOrNull.

Implementation

@override
T get value {
  final value = _wrapper.value;
  if (isNotEmpty(value)) {
    return value as T;
  }
  throw ValueStreamError.hasNoValue();
}
set value (T newValue)

Set and emit the new value.

Implementation

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