removeByKey method

Future<void> removeByKey(
  1. String key, {
  2. bool rebuildDb = false,
})

Remove data from cache by key.

Provide the same key that you used when adding the data to remove data from cache. This will remove all data withe the provided key.

Setting rebuildDb to true will clean up the SQL database and free up the space.

Implementation

Future<void> removeByKey(String key, {bool rebuildDb = false}) async {
  if (config.useMemCache) _memCache.removeByKey(key);
  await dataStore.removeByKey(key, rebuildDb: rebuildDb);
}