Reputation:
I read this question: How do I listen for custom events in Dart?
It tells you to dispatch events like:
window.on['foo'].dispatch(new CustomEvent('foo'));
However, with the latest version of Dart SDK, the on
is deprecated. So how can I do this?
Upvotes: 1
Views: 714
Reputation: 30212
The equivalent code in the latest SDK would be like:
window.dispatchEvent(new CustomEvent('foo'));
It does not need to be any harder than that ;)
Upvotes: 7