Baseflow / flutter_cached_network_image

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

Is the errorListener method disposed after the CachedNetworkImage is disposed? #951

Open limonadev opened 5 months ago

limonadev commented 5 months ago

💬 Questions and Help

I'm implementing a custom logging mechanism when the image loading fails. I found the errorListener really useful to get that info, but after some performance testing I noticed the callback from errorListener gets called even if the CachedNetworkImage widget gets disposed.

I took a look at the code and wasn't able to find a place where the method removeListener was used, except from testing files.

I'm asking this, because it seems like the regular Image.network widget from Flutter does call the removeListener method. If the method is not being called in this package, is there any reason to not do it? Is it safe from memory leaks?

Thanks!