ApplicationEvent class abstract

A base class for application-specific events within the JetLeaf framework.

Extends EventObject and allows capturing the event creation time using either the system clock or a custom clock function.

Subclasses of ApplicationEvent are used to represent meaningful events in the lifecycle of an application, such as context initialization, refresh, shutdown, etc.


Example

class ContextRefreshedEvent extends ApplicationEvent {
  ContextRefreshedEvent(Object source) : super(source);
}

final event = ContextRefreshedEvent(appContext);
print(event.source); // appContext
print(event.timestamp); // time of creation
Inheritance
Implementers

Constructors

ApplicationEvent(Object source, [DateTime? timestamp])
A base class for application-specific events within the JetLeaf framework.
const
ApplicationEvent.withClock(Object source, DateTime clock())
Creates a new ApplicationEventconst using a custom clock function.

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.
inherited
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.
inherited
getTimestamp() DateTime
Returns the timestamp of the event.
inherited
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
inherited

Operators

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