使用新库删除事件侦听器 [英] Remove event listener with the new library
本文介绍了使用新库删除事件侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为先前使用新dart图书注册的活动移除侦听器?
How do i remove a listener for an event I've previously registered to with the new dart library?
我使用这个侦听器侦听与新图书馆:
I'm using this to listen for events with the new library:
element.onMouseMove.listen
这是什么等效版本?
element.on.mouseMove.remove
推荐答案
element.onMouseMove.listen (...)
返回 StreamSubscription 。只需调用其 cancel()方法即可停止接收活动。
element.onMouseMove.listen(...)
returns a StreamSubscription. Simply call its cancel() method to stop receiving events.
这篇关于使用新库删除事件侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文