CHRISTOPANANJICKAL / fast_cached_network_image

A flutter package to cache network image fastly without native dependencies.
MIT License
29 stars 35 forks source link

Reload widget when change URL #6

Closed marcoprodata closed 1 year ago

marcoprodata commented 1 year ago

Dear friend, when change the url the widget dont update the image.

Observer( builder: (_) { return SizedBox( height: double.maxFinite, child: RotatedBox( quarterTurns: _rotate, child: FastCachedImage( url: premio.urlCanhoto, fit: BoxFit.fill, fadeInDuration: const Duration(seconds: 1), errorBuilder: (context, exception, stacktrace) { return Text(stacktrace.toString()); }, loadingBuilder: (context, progress) { return Container(); }, ), ), ); }, )

How to change URL and update the widget?

Thanks to advance

CHRISTOPANANJICKAL commented 1 year ago

Hii @marcoprodata, can you please explain in detail?

marcoprodata commented 1 year ago

Dear Friend, here's the thing, I have an object on the screen, and a list of items next to it, with each item I click I intend to change the image displayed on the widget, the url of the image is in a store, so when updating I expected the image was updated on the widget, but it doesn't

CHRISTOPANANJICKAL commented 1 year ago

Can you share the full piece of code so that i can look jnto tue issue

yzq666 commented 1 year ago

image Because the key is not updated, Imagecache not change,

WiRight commented 1 year ago

Maybe it will be much better solution for you?

await FastCachedImageConfig.deleteCachedImage(
      imageUrl: url,
);
CHRISTOPANANJICKAL commented 1 year ago

https://user-images.githubusercontent.com/58786637/233856487-8757d78e-55b2-46e8-8366-75c101103622.mp4

For images with different url using Key param will work. For images with the same url, you will have to delete the cached image first and then call the widget again. but somehow you need to identify whether the images are the same or different