Open Dhananjayan-PN opened 4 years ago
I'm trying to accomplish exactly this, and by coincidence I'm trying this right now. Revising the flutter_cached_network_image source code and flutter_cache_manager (used by the former) it seems the key parameter used by flutter_cache_manager as a lookup for cached files is not used anywhere bu cached_network_image. If I'm not missing anything, probably it'll be need to change CachedNetworkImageProvider to accept a lookup key and _loadAsync method to accept the same variable to be passed to Cache Manager (DefaultCacheManager) getFileStream method. I could put a pull request, but I don't know how to do that.
Alternatively, you could just extract the base url of your image and attach an http header with the token. This way your url for the same file will never change, so the CachedNetworkImage will work as expected.
Thanks for the tip! Do let me know if a fix is pushed.
Hi, I would like to cache a Network Image from a S3 bucket URL against an id or key. I tried to use the key: parameter but it didn't work. Please advise how I can achieve this. Heres the Cached Network Image code with the 'key' parameter that doesn't seem to do what I intend.