addNext method

void addNext(
  1. RestMiddleware<R> middleWare
)

This method adds a middleware to the chain. This method is called by the Rest library, no need to call it manually, instead use RestClientBuilder.addRequestMiddleware and RestClientBuilder.addResponseMiddleware

Implementation

void addNext(RestMiddleware<R> middleWare) {
  if (_next == null) {
    _next = middleWare;
  } else {
    _next?.addNext(middleWare);
  }
}