getCacheSize static method
获取当前缓存大小。
Implementation
static Future<String> getCacheSize() async {
final Directory tempDir = await getTemporaryDirectory();
double size = 0.0;
await for (final FileSystemEntity entity in tempDir.list()) {
if (entity is File) {
size += await entity.length();
}
}
return formatMemorySize(size);
}