optional method

void optional(
  1. dynamic condition,
  2. Middleware<T> optionalMiddleware
)

Conditionally runs optional middleware or skips middleware

Implementation

void optional(condition, Middleware<T> optionalMiddleware) {
  use(getOptionalMiddleware(condition, optionalMiddleware));
}