EventContext<T> class

Contains information passed to a listener when an event is emitted.

T represents the optional type of data associated with the event.

Example:

events.on<String>('user/login', (context) {
  print('Event: ${context.name}');
  print('Data: ${context.data}');
  print('Params: ${context.params}');
});

Constructors

EventContext.new(T? data, String name, List<String> params)
Creates a new event context.
const

Properties

data → T?
Data passed with the event, may be null.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Full name (or channel) of the emitted event.
final
params List<String>
Parameters extracted from the path when using wildcards (* or #).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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