Skip to content

onFinishedLoading image custom callback function #545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
anass-naoushi opened this issue Feb 24, 2021 · 6 comments
Open

onFinishedLoading image custom callback function #545

anass-naoushi opened this issue Feb 24, 2021 · 6 comments

Comments

@anass-naoushi
Copy link

🚀 Feature Requests

The title speaks for itself

@renefloor
Copy link
Contributor

Hmm not really. What do you want and why?

@rohankandwal
Copy link

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

@foreverGoUp
Copy link

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

@mark8044
Copy link

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

@eerbee
Copy link

eerbee commented Apr 20, 2022

any work around?

@MilosKarakas
Copy link

MilosKarakas commented Sep 26, 2023

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');
    }));
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants