EventObject class abstract

A base class for all framework-level events.

This class captures the origin of the event (_source) and the time it occurred (_timestamp). Subclasses typically define the specific type of event (e.g., context refresh, startup, shutdown).

Events are generally published and consumed within an application event system, allowing for decoupled communication between components.

Example

class ApplicationStartedEvent extends EventObject {
  ApplicationStartedEvent(Object source) : super(source);
}

final event = ApplicationStartedEvent(appContext);
print(event.getSource()); // appContext
print(event.getTimestamp()); // DateTime of creation

See also:

Implementers

Constructors

EventObject(Object _source, [DateTime? _timestamp])
Creates a new EventObject with the given source.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
getPackageName() String
Represents an abstraction for identifying the package that an object, resource, or service belongs to.
inherited
getSource() Object
Returns the source of the event.
getTimestamp() DateTime
Returns the timestamp of the event.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toStringOptions() → ToStringOptions

Operators

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