BaseEventServiceProvider class
The Event Service Provider.
This provider is responsible for registering all event listeners. Subclass this in your application to map events to listeners.
Usage
class EventServiceProvider extends BaseEventServiceProvider {
@override
Map<Type, List<MagicListener Function()>> get listen => {
UserRegistered: [
() => SendWelcomeEmail(),
() => LogRegistration(),
],
};
}
- Inheritance
-
- Object
- ServiceProvider
- BaseEventServiceProvider
Constructors
Properties
- app → MagicApp
-
Reference to the application container.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
listen
→ Map<
Type, List< MagicListener< >MagicEvent> Function()> -
The event listener mappings for the application.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
boot(
) → Future< void> -
Bootstrap any application services.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
) → void -
Register any application services.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited