show img size

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-16 17:23:09 +08:00
parent 0c60800b36
commit 88b7f82406
22 changed files with 122 additions and 38 deletions

View File

@@ -44,18 +44,6 @@ abstract final class CacheManager {
return total;
}
// 缓存大小格式转换
static String formatSize(num value) {
const unitArr = ['B', 'K', 'M', 'G', 'T', 'P'];
int index = 0;
while (value >= 1024) {
index++;
value = value / 1024;
}
String size = value.toStringAsFixed(2);
return size + (unitArr.elementAtOrNull(index) ?? '');
}
// 清除 Library/Caches 目录及文件缓存
static Future<void> clearLibraryCache() async {
try {