Event<P> class
Constructors
-
Event({String name = 'event', int historyLimit = -1})
-
New event of payload type
P
with name
Methods
-
addFilteredListener(EventListener<P> listener, ListenerFilter<P> filter, {bool useHistory = true})
→ ListenerKiller
-
the same as addListener but will call
listener
only if filter
returns true
-
addListener(EventListener<P> listener, {bool useHistory = true})
→ ListenerKiller
-
add
listener
to listeners
-
addTypedListener<T extends P>(EventListener<T> listener, {bool useHistory = true, bool useRuntimeType = false, List<Type>? excludedTypes})
→ ListenerKiller
-
the same as addListener but will call
listener
only if payload type is T
which is a subtype of P
-
clear([bool filter(EventListener<P> listener)?])
→ void
-
clear listeners list
-
clearHistory()
→ void
-
clear payloads history
-
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
-
loop()
→ void
-
call all listeners with the payloads queue
-
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
-
onNext([int? ignoreCount])
→ Future<P>
-
returns future that completes on next fire
-
removeListener(EventListener<P> listener)
→ void
-
remove
listener
-
toString()
→ String
-
A string representation of this object.
inherited