deleteCachedImage static method
deleteCachedImage function takes in a image imageUrl
and removes the image corresponding to the url
from the cache if the image is present in the cache.
Implementation
static Future<void> deleteCachedImage(
{required String imageUrl, bool showLog = true}) async {
_checkInit();
final key = _keyFromUrl(imageUrl);
if (_imageKeyBox!.keys.contains(key) && _imageBox!.keys.contains(key)) {
await _imageKeyBox!.delete(key);
await _imageBox!.delete(key);
if (showLog) {
debugPrint('FastCacheImage: Removed image $imageUrl from cache.');
}
}
}