EventSignal<T> class
A signal that can be dispatched to multiple listeners, with data of type T
.
Constructors
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
-
add(
EventSignalCallback< T> callback) → void -
Adds
callback
to the list of listeners. If it already exists in the list, it will not be added again. -
addOnce(
EventSignalCallback< T> callback) → void -
Adds
callback
to the list of listeners, but only once. It will be removed from the list after being dispatched once. -
call(
T data) → void -
Convenience method that calls dispatch with
data
as argument. Making the EventSignal instance callable. Example: -
dispatch(
T data) → void -
Dispatches the signal to all registered listeners, passing
data
to each listener. -
has(
EventSignalCallback< T> callback) → bool -
Returns true if
callback
is currently in the list of listeners. -
hasListeners(
) → bool - Returns true if the signal has any registered listeners.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
EventSignalCallback< T> callback) → void -
Removes
callback
from the list of listeners. -
removeAll(
) → void - Removes all listeners from the signal.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited