createDirSync method

Future<Directory?> createDirSync(
  1. String path
)

异步创建文件

Implementation

Future<Directory?> createDirSync(String path) async {
   if (path.isEmpty) {
     return null;
   }
  Directory dir = Directory(path);
  bool exist = await dir.exists();
  if (!exist) {
    dir = await dir.create(recursive: true);
  }
  return dir;
}