deleteFile function
Delete a directory recursively
Implementation
Future deleteFile(File file, {DeleteOptions? options}) async {
options ??= defaultDeleteOptions;
try {
await file.delete(recursive: options.recursive);
} catch (e) {
if (e is FileSystemException) {
if (e.status != FileSystemException.statusNotFound) {
// ignore: avoid_print
print('delete $file failed $e');
}
} else {
// ignore: avoid_print
print('delete $file failed $e');
}
}
if (options.create) {
await file.create(recursive: true);
}
}