createDirSync static method

Directory? createDirSync(
  1. String? path
)

同步创建文件夹

Implementation

static Directory? createDirSync(String? path) {
  if (path == null) return null;
  Directory dir = Directory(path);
  if (!dir.existsSync()) {
    dir.createSync(recursive: true);
  }
  return dir;
}