mod: fix iOS delete NSCachesDirectory no permission

This commit is contained in:
orz12
2024-07-23 12:00:50 +08:00
parent 4f6ef8d6d2
commit d4eb95d477
2 changed files with 7 additions and 2 deletions

View File

@@ -137,7 +137,12 @@ class CacheManage {
static Future clearLibraryCache() async {
var appDocDir = await getTemporaryDirectory();
if (appDocDir.existsSync()) {
await appDocDir.delete(recursive: true);
// await appDocDir.delete(recursive: true);
final List<FileSystemEntity> children =
appDocDir.listSync(recursive: false);
for (final FileSystemEntity file in children) {
await file.delete(recursive: true);
}
}
}