flush method

void flush(
  1. Dio dio,
  2. String token
)

Retries all queued requests with the new token.

Implementation

void flush(Dio dio, String token) {
  final pending = List.of(_queue);
  _queue.clear();
  for (final req in pending) {
    retry(dio, req.options, token).then(
      req.handler.resolve,
      onError: (e) => req.handler.reject(e as DioException),
    );
  }
}