Reputation: 4128
I added this before. myBtn.onClick.listen((_){//some code});
Now I want to remove the event from the button, so:
How do you remove the onClick event from a ButtonElement by code? I can't find an obvious way to do it.
Thank you.
Upvotes: 3
Views: 334
Reputation: 2022
The .listen() returns a subscription. Which you could store in a var and call .cancel() on.
Upvotes: 4