counstructPathToFile static method

void counstructPathToFile(
  1. String pathToFile, {
  2. bool asFolder = false,
})

When asFolder is true, pathToFile was a path to folder.

Implementation

static void counstructPathToFile(
  String pathToFile, {
  bool asFolder = false,
}) {
  final dir = asFolder ? pathToFile : ph.dirname(pathToFile);
  Directory(dir).createSync(recursive: true);
}