mchome / flutter_advanced_networkimage

flutter advanced network image provider
https://pub.dev/packages/flutter_advanced_networkimage
MIT License
285 stars 180 forks source link

force refetch image #130

Open EricPHassey opened 4 years ago

EricPHassey commented 4 years ago

Trying to enableRefresh properly.

I load images to display to user and want a button they can press to re-grab those images from the server. Download and cache them like new.

I've been looking at documentation and I see the enableRefresh property in the TransitionToImage. I have this set to true.

What do I need to do to actually trigger this refresh?

I saw someone else use this: DiskCache().evict(widget.url.hashCode.toString())

Would this be the proper way to pull new images in?

EricPHassey commented 4 years ago

Thanks for adding this in @mchome . I'm getting a "type GestureDetector is not a subtype of type 'MyRawImage'"

Not sure if I'm doing something wrong.

mchome commented 4 years ago

My bad, please try v0.6.2.

EricPHassey commented 4 years ago

Thanks @mchome that fixed the problem, however I'm struggling to use your awesome new feature in my code.

What I'm really looking for is if I press a button "refresh", it would refresh it. Using the longPress interferes with my code, as I already am using a GestureDetector for something else on the image.

Any chance you can have a flag that gets set to refresh it?