EventServiceProvider class abstract

Service provider for registering event listeners and subscribers.

Extend this class in your application to map events to their listeners.

Example:

class AppEventServiceProvider extends EventServiceProvider {
  @override
  Map<Type, List<Type>> get listen => {
    UserCreated: [SendWelcomeEmail],
  };

  @override
  List<Type> get subscribe => [
    UserEventSubscriber,
  ];
}
Inheritance

Constructors

EventServiceProvider()

Properties

hashCode int
The hash code for this object.
no setterinherited
isDeferred bool
If true, the provider is deferred and only loaded when its services are requested.
no setterinherited
listen Map<Type, List<Type>>
The event handler mappings for the application.
no setter
provides List<Type>
The services provided by this provider.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscribe List<Type>
The subscriber classes to register.
no setter

Methods

boot(ContainerInterface container) Future<void>
Called after all providers are registered (for initialization).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(ContainerInterface container) → void
Called when the provider is registered in the container.
override
toString() String
A string representation of this object.
inherited

Operators

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