delete method
Deletes the FileSystemEntity reference by path
.
Implementation
Future<void> delete(String path, {bool mustExist = false}) =>
entity(path).then((e) async {
if (e == null) {
if (mustExist) {
throw FileSystemException('No such file or directory', path);
} else {
return;
}
}
await e.delete(recursive: true);
});