remove method
Remove data from cache.
Provide the same key
that you used when adding the data to remove
data from cache. You can also use queryParams
to specify the query
parameters you used to fetch and cache the data. If you cached a data with
both key
and queryParams
, then you will need to provide both
parameters to remove the data.
Setting rebuildDb
to true
will clean up the SQL database and free up
the space.
Implementation
Future<void> remove(
String key, {
Map<String, dynamic> queryParams = const <String, dynamic>{},
bool rebuildDb = false,
}) async {
final params = QueryParams(queryParams);
if (config.useMemCache) _memCache.remove(key, params.asStr);
await dataStore.remove(key, params, rebuildDb: rebuildDb);
}