Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.43k stars 653 forks source link

Prevent loader from appearing when image is preloaded or when image has finished loading #716

Open nicolasvahidzein opened 2 years ago

nicolasvahidzein commented 2 years ago

Wonderful package btw.

When images load the loader appears one more time before displaying the image it is jarring. Same thing for precached images, the loader appears and completes one circle quickly before showing the image.

Any ideas?

Thanks.

AmineLAHRIM commented 2 years ago

same

talhakhan1297 commented 2 years ago

same

nicolasvahidzein commented 1 year ago

Guys, any progress on this issue?

Khader-1 commented 1 year ago

I suggest you keep your precached ImageProvider object and use it to render an image directly using flutter's Image Widget. for example:

// in splash screen
await precacheImage(
          controller.boardingImg, // CachedNetworkImageProvider(url)
          context,
        );

then use the same object you precached before:

// later in the app

Image(image: controller.boardingImg)
nicolasvahidzein commented 1 year ago

@Khader-1 can you please send a full code sample, that controller is coming from where?

Thanks again for you help.