scan method

Implementation

Future<List<StorageFile>> scan() async {
  List<StorageFile> files = [];

  ListResultForAll result = await listAll();
  for (var item in result.items) {
    await child(item.name).getMetadata().then((value) => files.add(
        StorageFile(
            cloudPath: "$fullPath/${item.name}",
            fileName: item.name,
            reference: item,
            size: value.size!)));
  }
  var dirs = result.prefixes;
  for (var dir in dirs) {
    files.addAll((await child(dir.name).scan()));
  }
  return files;
}