use method

void use(
  1. Middleware middleware
)

Adds a middleware to the list of middlewares that will be executed in order. Note that the order of execution is the same as the order of addition. You can add a middleware at any time, but it will only start executing on new requests. If you add a middleware after the server is started, it will be executed on new requests, but not on requests that are already in progress.

Implementation

void use(Middleware middleware) {
  _middlewares.add(middleware);
}