各位 Dart 程序员。
我正在使用 Stream 读取文件,如下所示。
Stream<List<int>> stream = new File(filepath).openRead();
stream
.transform(UTF8.decoder)
.transform(const LineSpilitter())
.listen((line){
// TODO: check if this is the last line of the file
var isLastLine;
});
Run Code Online (Sandbox Code Playgroud)
我想检查listen()中的行是否是文件的最后一行。