remove method

  1. @override
Future<void> remove(
  1. String key,
  2. QueryParams queryParams, {
  3. bool rebuildDb = false,
})
override

Remove data from storage.

Remove data by both the key and queryParams. And setting rebuildDb to true will clean up the SQL database and free up the space.

Implementation

@override
Future<void> remove(
  String key,
  QueryParams queryParams, {
  bool rebuildDb = false,
}) async {
  final db = await _getDb();
  await db.delete(
    _cacheTable,
    where: '$_cacheKey = ? and $_params = ?',
    whereArgs: [key, queryParams.asStr],
  );
  if (rebuildDb) await db.execute('vacuum');
}