getAllDirectoryinDirectory static method

Future<List<Directory>> getAllDirectoryinDirectory(
  1. dynamic path
)

Implementation

static Future<List<Directory>> getAllDirectoryinDirectory(path) async {
  List<Directory> files = [];
  Directory? directory = Directory(path);
  if (await directory.exists()) {
    List<FileSystemEntity> entities = directory.listSync(recursive: true);
    for (var entity in entities) {
      if (entity is Directory) {
        files.add(entity);
      }
    }
  }
  return files;
}