DataEvent<TData> class
abstract
Data events are events that can be triggered with associated data to notify listeners.
When triggered, the event holds the data temporarily during notification. Notice that you should not use the data property asynchronously after triggering because next time the event is triggered, the data will be overridden and may cause unexpected results. If you need to keep the data for later use, consider copying it before use or using a component instead.
- Inheritance
-
- Object
- Element
- Entity
- ListenableEntity
- DataEvent
Constructors
Properties
- data → TData
-
The current data of the event.
no setter
- dataOrNull → TData?
-
The current data of the event, or null if none.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- identifier → String
-
Unique identifier for this entity.
no setterinherited
- inspectorId → String?
-
no setterinherited
- isAttached → bool
-
Indicates whether this entity is active (i.e., has a parent feature).
no setterinherited
-
listeners
→ Set<
EntityListener> -
Set of listeners for this entity.
finalinherited
- orchestration → Orchestration?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- triggeredAt → DateTime?
-
The last triggered timestamp of the event, or null if never triggered.
no setter
Methods
-
addListener(
EntityListener listener) → void -
Adds a listener to this entity.
inherited
-
attach(
Orchestration orchestration) → void -
Attaches this entity to an orchestration.
inherited
-
describe(
[TData? data]) → String -
Builds a string descriptor for this entity in inspector.
override
-
log(
String message, {LogLevel level = LogLevel.info}) → void -
Logs a message to logging system.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
inherited
-
removeListener(
EntityListener listener) → void -
Removes a listener from this entity.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
TData data) → void -
Triggers the event with associated
data, notifying all listeners.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited