createDirectory function

Future<Directory> createDirectory(
  1. Directory dir, {
  2. CreateOptions? options,
})

Create a directory recursively

Implementation

Future<Directory> createDirectory(Directory dir,
    {CreateOptions? options}) async {
  options ??= defaultCreateOptions;
  if (options.delete) {
    await deleteDirectory(dir);
  }
  await dir.create(recursive: options.recursive);
  return dir;
}