lock method Null safety

void lock()

Lock the interceptor.

Once the request/response interceptor is locked, the incoming request/response will be added to a queue before they enter the interceptor, they will not be continued until the interceptor is unlocked.

Implementation

void lock() {
  if (!locked) {
    _completer = Completer();
    _lock = _completer.future;
  }
}