removeCache method

void removeCache(
  1. String key
)

Removes the cache entry associated with the given key.

Implementation

void removeCache(String key) {
  switch (cacheSource) {
    case CacheSource.memory:
      _cacheMemory.remove(key);
      break;
    case CacheSource.file:
      try {
        var file = File(
          joinPaths([FinchApp.config.pathCache, "cache_$key.json"]),
        );
        if (file.existsSync()) {
          file.deleteSync();
        }
      } catch (e) {
        Print.warning('Error deleting cache file: $e');
      }
      break;
  }
}