createDirectory function

bool createDirectory(
  1. String path
)

Creates a directory at path (including any missing parents).

Returns true if it was created, or false if it already existed.

Implementation

bool createDirectory(String path) {
  final dir = Directory(path);

  if (dir.existsSync()) {
    return false;
  }

  dir.createSync(recursive: true);
  logCreate(path);
  return true;
}