XRouteEntry class final

Represents a RouteEntry whose handler accepts both a ServerHttpRequest and a ServerHttpResponse.

This variant is used for advanced handlers that need to write to the response directly (e.g., streaming, manual content control).

Example

final entry = XRouteEntry(
  POST('/upload'),
  (req, res) async {
    await res.getBody().writeString('Upload complete');
    return null;
  },
);

Equivalent to:

router.postX('/upload', (req, res) async {
  await res.getBody().writeString('Upload complete');
});
Inheritance

Constructors

XRouteEntry(Route route, XRouterFunction handler)
Represents a RouteEntry whose handler accepts both a ServerHttpRequest and a ServerHttpResponse.
const

Properties

handler XRouterFunction
The handler function that receives both ServerHttpRequest and ServerHttpResponse.
final
hashCode int
The hash code for this object.
no setterinherited
route Route
The route definition associated with this entry.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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