Cascade class Null safety

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.
read-only
hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(Handler handler) Cascade
Returns a new cascade with handler added to the end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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