delDir static method
递归方式删除目录
Implementation
static Future<void> delDir(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
await delDir(child);
}
}
if (Platform.isAndroid) {
await file.delete();
} else if (file.path.split("/").last.toLowerCase() != "caches") {
await file.delete();
}
}