read method

T read()

Reads the current value and records it as this build's, together with the observed state and what is beside the value.

All three are read before any is recorded, so a read that throws leaves the last one standing, and nothing it did not finish counts as built.

Implementation

T read() {
  final Object? state = _observedState();
  final Object? beside = _beside?.call();
  final T value = _value();
  _builtState = state;
  _builtBeside = beside;
  _recorded = true;
  return _built = value;
}