I have a stream with a transformer that fuses the UTF8.decoder
to the LineSplitter
. It works great but never calls the function specified in the onDone
parameter.
import 'dart:async';
import 'dart:io';
import 'dart:convert';
void main(List<String> arguments) {
Stream<List<int>> stream = new File("input.txt").openRead();
stream.transform(UTF8.decoder.fuse(const LineSplitter()))
.listen((line) {
stdout.writeln(line);
}, onDone: () {
stdout.write("done");
}).asFuture().catchError((_) => print(_));
}
Any ideas why it is never getting called?