removeCache method
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;
}
}