parseDomainDirectory static method

Directory? parseDomainDirectory(
  1. Object? dirPath, {
  2. bool checkDirectoryExistence = false,
})

Parses a domain Directory.

Implementation

static Directory? parseDomainDirectory(Object? dirPath,
    {bool checkDirectoryExistence = false}) {
  if (dirPath == null) return null;
  if (dirPath is Directory) return dirPath;
  var p = dirPath.toString();
  var dir = Directory(p);
  return !checkDirectoryExistence || dir.existsSync() ? dir : null;
}