deleteDir static method

bool deleteDir(
  1. String dirPath
)

Implementation

static bool deleteDir(String dirPath) {
  final dir = Directory(dirPath);
  if (dir.existsSync()) {
    try {
      dir.deleteSync(recursive: true);
      return true;
    } catch (e) {
      return false;
    }
  }
  return false;
}