delete method
- {bool recursive = false}
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
Future<void> delete({bool recursive = false}) async {
if (kIsWeb || this.path.isEmpty) return;
await File(this.path).delete(recursive: recursive);
}