EventComponent<P> class abstract

Constructors

EventComponent({String name = 'event', int historyLimit = -1})

Properties

event Event<P>
latefinal
hashCode int
The hash code for this object.
no setterinherited
lastPayload → P?
get the latest payload if exists else returns null
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fire(P payload, {bool useHistory = true, Duration? delay, bool silent = false}) → void
Fire the payload to all listeners.
linkTo<R>(Event<R> event, PayloadConverter<P, R> converter, {bool useHistory = true, Duration? delay, bool silent = false}) ListenerKiller
add listener with converter callback to convert payload of type P to payload of type R then fires the new payload using event
listenTo(Event<P> event, {bool useHistory = true, Duration? delay, bool silent = false}) ListenerKiller
listens to another Event of the same type
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify([Duration? delay]) → void
fires a null payload without using history
off(EventListener<P> listener) → void
Remove listener from the current event
on(EventListener<P> listener, {bool useHistory = true, ListenerFilter<P>? filter}) ListenerKiller
add listener to the current event
onType<T extends P>(EventListener<T> listener, {bool useHistory = true, bool useRuntimeType = false, List<Type>? excludedTypes}) ListenerKiller
Add typed listener to the current event to be called only if payload type is T which is a subtype of P
toString() String
A string representation of this object.
inherited

Operators

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