flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

onFinishedLoading image custom callback function

Open anass-naoushi opened this issue 4 years ago • 6 comments

🚀 Feature Requests

The title speaks for itself

anass-naoushi avatar Feb 24 '21 02:02 anass-naoushi

Hmm not really. What do you want and why?

renefloor avatar Feb 24 '21 07:02 renefloor

Hmm not really. What do you want and why?

When we need any specific functionality to perform post image load. Eg - https://stackoverflow.com/questions/44665955/how-do-i-determine-the-width-and-height-of-an-image-in-flutter

rohankandwal avatar Apr 09 '21 09:04 rohankandwal

yeah!I Hope you can add this callback.because I need show a button after the image loaded in ad page. @renefloor

foreverGoUp avatar Sep 08 '21 02:09 foreverGoUp

Agree, this functionality will become more and more vital as more people use this.

I too need to get image dimensions as well as change the state of app when an image loads.

Much thanks if this can become reality

mark8044 avatar Feb 23 '22 16:02 mark8044

any work around?

eerbee avatar Apr 20 '22 04:04 eerbee

For context: I'm using regular Image widget and providing the image for it with CachedNetworkimageProvider. I pulled the provider into a variable and then added an ImageStreamListener to it. The ImageStreamListener has an onImage callback which gives you the ImageInfo object with original dimensions of the loaded image.

Example:

late CachedNetworkImageProvider provider;

  @override
  void initState() {
    super.initState();
    provider = CachedNetworkImageProvider(imageUrl);
    provider.resolve(const ImageConfiguration()).addListener(ImageStreamListener((image, __) {
      print('Image is $image');
    }));
  }

MilosKarakas avatar Sep 26 '23 17:09 MilosKarakas