# EventType<T extends ApplicationEvent> class final

🫘 Represents a typed application event associated with a specific package.

The EventType class is a simple container that binds an ApplicationEvent instance with the name of the package that produced it. This allows events to be categorized, filtered, or routed based on their originating package.

## Type Parameter

- `T` – The concrete type of ApplicationEvent this EventType holds.

## Example

    class UserCreatedEvent extends ApplicationEvent {
      final String userId;
      const UserCreatedEvent(this.userId);
    }

    @EventListener(EventType<UserCreatedEvent>('user_package'))
    void handleUserCreatedEvent(UserCreatedEvent event) {
      print("User created: ${event.userId}");
    }

    void main() {
      final event = UserCreatedEvent('12345');
      final eventType = EventType(event, 'user_package');

      print('Event: ${eventType.event}, Package: ${eventType.packageName}');
    }

## Use Cases

- Event-driven application architectures.
- Associating events with their defining package/module.
- Passing typed event metadata through the JetLeaf lifecycle.

See also:

- ApplicationEvent 🫘 the base class for application events.

Annotations
  - @Generic(EventType)

## Constructors

EventType.new([String? _packageName])
  Creates a new EventType with the given `event` and `_packageName`.
  const

## Properties

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

## Methods

getType() → Class<T>
  Returns the type of ApplicationEvent this EventType holds.
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