before method

void before(
  1. RouteInterceptor interceptor, [
  2. List<RouteInterceptor>? interceptors
])

Add interceptor and optionally interceptors to be executed before handler in the route chain.

Implementation

void before(RouteInterceptor interceptor,
    [List<RouteInterceptor>? interceptors]) {
  _before.add(interceptor);
  if (interceptors != null) {
    _before.addAll(interceptors);
  }
}