deleteSync method

void deleteSync(
  1. String path, {
  2. bool mustExist = false,
})

Synchronously deletes the FileSystemEntity reference by path.

Implementation

void deleteSync(String path, {bool mustExist = false}) {
  final e = entitySync(path);
  if (e == null) {
    if (mustExist) {
      throw FileSystemException('No such file or directory', path);
    } else {
      return;
    }
  }
  e.deleteSync(recursive: true);
}