read method

Listened read()

Obtains the value currently exposed by the provider.

This implicitly calls flush, which may cause a provider to be recomputed.

Implementation

Listened read() {
  if (_listener.list == null) {
    throw StateError(
      'Cannot call ProviderSubscription.read() after close was called',
    );
  }
  _listener.element.flush();
  _listener.lastNotificationCount = _listener.element._notificationCount;
  return _listener.element.getExposedValue();
}