RouteMatchedEvent class final

Event fired when a route is successfully matched.

This event is emitted after a route has been matched to the request but before the route's handler is executed. Listeners can use this to log matched routes, perform route-specific setup, or modify the context before handler execution.

Example:

eventManager.listen<RouteMatchedEvent>((event) {
  final routeName = event.route.name ?? 'unnamed';
  print('Matched route: $routeName (${event.route.path})');

  // Add route information to context
  event.context.set('route_name', routeName);
});
Inheritance

Constructors

RouteMatchedEvent(EngineContext context, EngineRoute route)
Creates a new route matched event.

Properties

context EngineContext
The engine context for the current request.
final
hashCode int
The hash code for this object.
no setterinherited
route EngineRoute
The matched route.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
The timestamp when the event was created.
finalinherited

Methods

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