EventMethod class
A single event handler method.
EventMethod is a class that represents a single event handler method. It contains the event name, the handler function, the priority of the handler, and whether the handler should be called only once.
EventMethod is used by EventSubscriber to register events.
- Annotations
-
- @Deprecated('Use the new Event system with Listener classes instead')
Constructors
-
EventMethod({required String eventName, required Future<
void> handler(dynamic payload), EventPriority priority = EventPriority.normal, bool once = false}) - Creates a new EventMethod instance.
Properties
- eventName → String
-
The name of the event this method is listening to.
final
-
handler
→ Future<
void> Function(dynamic payload) -
The handler function that will be called when the event is fired.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- once → bool
-
Whether the handler should be called only once.
final
- priority → EventPriority
-
The priority of the handler.
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited