remove method
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');
}