Closed sports7744 closed 1 month ago
Hi @sports7744 👋
Thanks for opening an issue and good catch -- the call to removeListener
is not necessary since the dispose
call will remove the listeners. I fixed this in https://github.com/felangel/bloc/commit/41d232b0c5ed96050ed9fd2490c5a713b9a688a0, thanks again!
Hi @felangel!
While working on a component inspired by the
PostsList
class from the Infinite list project, I noticed something that prompted a question. In thedispose
method, there's an explicit call toremoveListener
for the_scrollController
:Could you provide some insight into why
removeListener
is used explicitly here? My understanding is that callingdispose()
should typically take care of cleaning up listeners. I want to ensure that I'm following best practices, so any guidance on this decision would be greatly appreciated.Thanks!