fetchStream method Null safety

Stream<T> fetchStream(
  1. Stream<T> callback(

    Returns a cached stream from a previous call to fetchStream, or runs callback to compute a new stream.

    If fetchStream has been called recently enough, returns a copy of its previous return value. Otherwise, runs callback and returns its new return value.


    Stream<T> fetchStream(Stream<T> Function() callback) {
      if (_cachedValueFuture != null) {
        throw StateError('Previously used to cache via `fetch`');
      var splitter = _cachedStreamSplitter ??= StreamSplitter(
          callback().transform(StreamTransformer.fromHandlers(handleDone: (sink) {
      return splitter.split();