cloneWith method Null safety

Route cloneWith(
  1. {HttpMethod? info,
  2. List<RouteInterceptor>? after,
  3. List<RouteInterceptor>? before,
  4. List<ExceptionHandler>? onException,
  5. RouteHandler? handler}
)

Clones this Route with the new values if provided

Implementation

Route cloneWith(
        {HttpMethod? info,
        List<RouteInterceptor>? after,
        List<RouteInterceptor>? before,
        List<ExceptionHandler>? onException,
        RouteHandler? handler}) =>
    Route.fromInfo(
      info ?? this.info,
      handler ?? this.handler,
      before: before ?? this._before.toList(),
      after: after ?? this._after.toList(),
      onException: onException ?? this._onException.toList(),
    );