createOrExistsDir static method

bool createOrExistsDir(
  1. String dirPath
)

Implementation

static bool createOrExistsDir(String dirPath) {
  final dir = Directory(dirPath);
  if (dir.existsSync()) return true;
  try {
    dir.createSync(recursive: true);
    return true;
  } catch (_) {
    return false;
  }
}