handler method

  1. @override
FutureOr<ResponseEntity> handler(
  1. RequestEntity request
)
override

Implementation

@override
FutureOr<ResponseEntity> handler(RequestEntity request) {
  AbstractWinterRouter? router = routes.firstWhereOrNull(
    (element) => element.canHandle(request),
  );
  if (router == null) {
    throw StateError(
      'MultiRouter: Can\'t find a route to handle the request',
    );
  }
  return router.handler(request);
}