# EventType<T extends ApplicationEvent> constructor

const EventType<T extends ApplicationEvent>([

1. String? _packageName

])

Creates a new EventType with the given `event` and `_packageName`.

🫘 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.

## Implementation

    const EventType([this._packageName]);