deleteSync method

void deleteSync(
  1. {bool recursive = false}
)

Synchronously deletes this XFile.

If the XFile is a directory, and if recursive is false, the directory must be empty. Otherwise, if recursive is true, the directory and all sub-directories and files in the directories are deleted. Links are not followed when deleting recursively. Only the link is deleted, not its target.

Implementation

void deleteSync({bool recursive = false}) {
  if (kIsWeb || this.path.isEmpty) return;
  File(this.path).deleteSync(recursive: recursive);
}