Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-11-05 10:38:11 +07:00
co-authored by Claude Opus 5.5
commit 2d26ea8f90
1071 changed files with 100151 additions and 0 deletions
@@ -0,0 +1,32 @@
import 'dart:io';
import 'package:path_provider/path_provider.dart';
import '../debug_log.dart';
//图片磁盘缓存目录(2025-07 ~ 2026-06 的版本经 loadAndDecrypt 往里存过原图,当前无写入方,保留统计和清理给老用户兜底)
class ImageDiskCache {
static Future<String> findSavePath() async {
final directory = await getTemporaryDirectory();
String saveDir = '${directory.path}/cacheImage';
Directory root = Directory(saveDir);
if (!root.existsSync()) {
debugLog(saveDir);
await root.create();
}
return saveDir;
}
static Future<void> emptyCache() async {
try {
String saveDir = await findSavePath();
Directory root = Directory(saveDir);
if (root.existsSync()) {
await root.delete(recursive: true);
}
} catch (e) {
debugLog(e);
}
}
}