RouteData class

Holds the handler and metadata for a specific route.

Constructors

RouteData({Handler? handler, WebSocketHandler? wsHandler, List<Middleware> middleware = const [], String? name, String? handlerName, required String method, required String path})
Creates a new RouteData instance.

Properties

compiledHandler → Handler?
Returns the pre-compiled execution chain.
no setter
description ↔ String?
A detailed description of the route.
getter/setter pair
displayHandler → String
Returns a clean display name for this route's handler.
no setter
handler → Handler?
The HTTP handler for this route, if applicable.
final
handlerName ↔ String?
The optional explicit handler or action name (e.g. 'UserController.index').
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isWebSocket → bool
Returns true if this route is a WebSocket entry point.
no setter
metadata → Map<String, dynamic>
Arbitrary metadata for the route (e.g., tags, security requirements).
final
method → String
The HTTP method (GET, POST, etc.) or 'WS' for WebSockets.
final
middleware → List<Middleware>
The list of middleware to be executed for this specific route.
final
name → String?
The optional name of the route, used for URL generation.
final
path → String
The full path pattern for this route.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
summary ↔ String?
A short summary of what the route does.
getter/setter pair
wsHandler → WebSocketHandler?
The WebSocket handler for this route, if applicable.
final

Methods

compile() → void
Compiles the route's middleware into a single executable chain.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDescription(String text) → RouteData
Fluent method to set the route description.
setHandlerName(String name) → RouteData
Fluent method to set the route handlerName.
setMeta(String key, dynamic value) → RouteData
Fluent method to add custom metadata entries.
setSummary(String text) → RouteData
Fluent method to set the route summary.
toString() → String
A string representation of this object.
inherited

Operators

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