static Future<void> removeFile(String url, {String? cacheKey}) {
return CachedNetworkImage.evictFromCache(url, cacheKey: cacheKey).then((value) {
CachedNetworkImageProvider(
url,
cacheKey: cacheKey,
).obtainKey(const ImageConfiguration()).then((key) {
///清除组件中缓存的图片
PaintingBinding.instance.imageCache.evict(key);
});
});
}
需要保证CachedNetworkImageProvider传入的参数cacheKey ?? url, scale, maxHeight, maxWidth一直