afterResponse method
Called before the response is returned.
Implementation
@override
@nonVirtual
Future<InterceptorResult<HttpResponse>> afterResponse(
HttpResponse response,
) async {
final isRetry = response.request.additionalData[key] ?? false;
if (isRetry) {
// Don't start a retry loop if we're already retrying.
return Interceptor.next();
}
if (!shouldRetry(response, null)) {
return Interceptor.next();
}
return _retry(response, null);
}