Evented class

Implementers
Annotations
  • @JS()
  • @anonymous

Constructors

Evented()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventParent(Evented obj) Evented
Adds an event parent - an Evented that will receive propagated events
fire(String type, [dynamic data, bool? propagate]) Evented
Fires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties. The event can optionally be propagated to event parents.
listens(String type) bool
Returns true if a particular event type has any listeners attached to it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String type, [Function? fn, dynamic context]) Evented
Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
on(String type, Function fn, [dynamic context]) Evented
Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
once(String type, Function fn, [dynamic context]) Evented
Behaves as on(…), except the listener will only get fired once and then removed.
removeEventParent(Evented obj) Evented
Removes an event parent, so it will stop receiving propagated events
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited