📜  目录中的 dart 列表文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:20.530000             🧑  作者: Mango

代码示例1
Future> dirContents(Directory dir) {
  var files = [];
  var completer = Completer>();
  var lister = dir.list(recursive: false);
  lister.listen ( 
      (file) => files.add(file),
      // should also register onError
      onDone:   () => completer.complete(files)
      );
  return completer.future;
}