# EventListener constructor

const EventListener([

1. EventType<ApplicationEvent>? event

])

Annotation to mark a method that should run when the application is listening to a specific type of ApplicationEvent.

This is typically used to register event listeners in the application context, allowing them to receive and process events published by the framework or custom domain events.

The only acceptable method signatures are:

- No-Arg: The method should not accept any arguments.
- One-Arg: The method should accept a single argument of type `ApplicationEvent`.

### Example

    class MyApp {
      @EventListener()
      void handleEvent(ApplicationEvent event) {
        print("Event received: $event");
      }

      @EventListener(EventType<ContextRefreshedEvent>('user_package'))
      void handleContextRefreshedEvent() {
        print("Context refreshed");
      }
    }

## Implementation

    const EventListener([this.event]);