onDone<T> method Null safety

Stream<T> onDone<T>(
  1. Stream<T> stream,
  2. void onDone(
      )
    )

    Implementation

    Stream<T> onDone<T>(Stream<T> stream, void Function() onDone) =>
        stream.transform(StreamTransformer.fromHandlers(handleDone: (sink) {
          sink.close();
          onDone();
        }));