Event class
Event - Represents an event in the system
Events are identified by name (string) and carry a data payload. This enables decoupled plugin-to-plugin communication without requiring shared type definitions.
Example:
// Fire an event
EventBus().fire('user.profile.updated', data: {'userId': '123'});
// Listen to an event
EventBus().on('user.profile.updated', (event) {
print('User updated: ${event.data['userId']}');
});
Constructors
Properties
-
data
→ Map<
String, dynamic> -
Data payload for this event
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
metadata
→ Map<
String, dynamic> ? -
Optional metadata for the event
final
- name → String
-
The name/type of this event
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timestamp → DateTime
-
Timestamp when the event was created
final
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