Baseflow / Baseflow/flutter_cached_network_image

Is the errorListener method disposed after the CachedNetworkImage is disposed?

Open
#951 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

## 💬 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](https://github.com/Baseflow/flutter_cached_network_image/blob/develop/cached_network_image/test/image_stream_completer_test.dart#L120).

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.