decodeStream method Null safety

Future<String> decodeStream (
  1. Stream<List<int>> byteStream
)

Implementation

Future<String> decodeStream(Stream<List<int>> byteStream) {
  return decoder
      .bind(byteStream)
      .fold(StringBuffer(),
          (StringBuffer buffer, String string) => buffer..write(string))
      .then((StringBuffer buffer) => buffer.toString());
}