removeByKey method
Remove data from storage by key
.
Setting rebuildDb
to true
will clean up the SQL database and free up
the space.
Implementation
@override
Future<void> removeByKey(String key, {bool rebuildDb = false}) async {
final db = await _getDb();
await db.delete(
_cacheTable,
where: '$_cacheKey = ?',
whereArgs: [key],
);
if (rebuildDb) await db.execute('vacuum');
}