loadCache static method

Future<String?> loadCache()

加载缓存

Implementation

static Future<String?> loadCache() async {
  try {
    var _tempDir = await getTemporaryDirectory();
    double value = 0;
    var exists = await _tempDir.exists();
    if (exists) {
      value = await _getTotalSizeOfFilesInDir(_tempDir);
    }
    /*tempDir.list(followLinks: false,recursive: true).listen((file){
        //打印每个缓存文件的路径
      print(file.path);
    });*/
    String cacheSize = _renderSize(value);
    logger.d('临时目录大小「$cacheSize」');
    return cacheSize;
  } catch (err) {
    logger.e('$err');
    return null;
  }
}