LazyStream<T> constructor

LazyStream<T>(
  1. FutureOr<Stream<T>> callback()
)

Creates a single-subscription Stream that calls callback when it gets a listener and forwards to the returned stream.

Implementation

LazyStream(FutureOr<Stream<T>> Function() callback) : _callback = callback {
  // Explicitly check for null because we null out [_callback] internally.
  if (_callback == null) throw ArgumentError.notNull('callback');
}