clearCache static method

FileResult<Map<FolderType, bool>> clearCache()

清理缓存文件(目前仅清理预加载文件夹)

Clears cache files (currently only clears the preload folder).

Implementation

static FileResult<Map<FolderType, bool>> clearCache() {
  final Map<FolderType, bool> results = {};
  final List<String> errors = [];

  final result = clearFolder(FolderType.preload);
  results[FolderType.preload] = result.success;
  if (!result.success) {
    errors.add('Preload: ${result.error}');
  }

  if (errors.isNotEmpty) {
    logw('Some cache clearing operations failed: ${errors.join(', ')}');
    return FileResult.failure(errors.join(', '));
  }

  return FileResult.success(results);
}