Skip to content
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

Stop listen event not working with one event #72

Closed
ghost opened this issue Sep 11, 2019 · 2 comments
Closed

Stop listen event not working with one event #72

ghost opened this issue Sep 11, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 11, 2019

Hello. I am having trouble stopping listening to the event. Specifically, I have a dialog, when opening the dialog (a statefull widget), in initState() I declare listening to the 'ABC' event. At the time of closing the dialog, specifically in dispose(), I off listening. When it first opens the dialog, it works smoothly. However, from the 2nd time on, I did not receive any messages from the event no matter what I registered to listen. Currently I have solved it temporarily by adding the code to remove eventName in _listeners at the end of off(...) function. I post to hope you find and have a fix for this case that is better than my way, because my way is only temporary and I don't know if my way has a bug or not. Thank you.

if (_listeners.containsKey(eventName)) {
      _listeners.remove(eventName);
    }
@tiholic
Copy link
Contributor

tiholic commented Sep 12, 2019

@huynhphu-pufu thanks for the report, this issue is fixed in 0.3.7

tiholic pushed a commit that referenced this issue Sep 12, 2019
 [Stop listen event not working with one event #72](#72)
@ghost
Copy link
Author

ghost commented Sep 12, 2019

Thank you so much 💯

@ghost ghost closed this as completed Sep 12, 2019
This issue was closed.
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

1 participant