Cascade class

A helper that calls several handlers in sequence and returns the first acceptable response.

By default, a response is considered acceptable if it has a status other than 404 or 405; other statuses indicate that the handler understood the request.

If all handlers return unacceptable responses, the final response will be returned.

 var handler = new Cascade()
     .add(webSocketHandler)
     .add(staticFileHandler)
     .add(application)
     .handler;

Constructors

Cascade({Iterable<int>? statusCodes, bool shouldCascade(Response)?})
Creates a new, empty cascade.

Properties

handler Handler
Exposes this cascade as a single handler.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Handler handler) Cascade
Returns a new cascade with handler added to the end.
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