lines method
Returns the stream transformed as UTF8 strings separated by line breaks.
This is similar to synchronous code using Stdin.readLineSync:
while (true) {
var line = stdin.readLineSync();
// ...
}
... but asynchronous.
Implementation
Stream<String> lines({Encoding encoding = systemEncoding}) =>
transform(utf8.decoder).transform(const LineSplitter());