clearAllCache static method

Future<void> clearAllCache()

Clears all existing cache entries from both memory and file system.

Implementation

static Future<void> clearAllCache() async {
  _cacheMemory.clear();
  var cacheDir = Directory(FinchApp.config.pathCache);
  if (cacheDir.existsSync()) {
    cacheDir.list().forEach((file) {
      if (file is File && file.path.endsWith('.json')) {
        try {
          file.delete();
        } catch (e) {
          Print.warning('Error deleting cache file: $e');
        }
      }
    });
  }
}