onGetChildren method

  1. @override
Stream<VEntity> onGetChildren(
  1. VFolder folder
)
override

Implementation

@override
Stream<VEntity> onGetChildren(VFolder folder) async* {
  yield* toDirectory(folder.path).list().asyncMap((entity) {
    if (entity is Directory) {
      return _vfolder(VPaths.join(folder.path, VPaths.name(entity.path)));
    } else if (entity is File) {
      return _vfile(
        VPaths.join(folder.path, VPaths.name(entity.path)),
      );
    }

    return null;
  }).whereType<VEntity>();
}