Is there some kind of way to clear onClick listeners on a button in Dart HTML that doesn't require keeping track of all the listeners?
This code is executed each time a certain div is made visible and onClick listeners are attached to certain buttons, if it's hidden and shown again, more onClick listeners are attached and the old onClick event which is no longer valid is also being called.
querySelectorAll("button.update-something").forEach((ButtonElement b) {
b.onClick.listen((e) {
// Do Stuff
});
}
Is there a way to clear existing onClick listeners or override the existing onClick listener without having to keep track of previous onClick listeners?