RetryContext.from constructor

RetryContext.from(
  1. YKNetworkingRequest request
)

Creates a RetryContext from a request.

Request params are shallow-copied — sensitive data in the original request's params map will be present in the retry context.

Implementation

factory RetryContext.from(YKNetworkingRequest request) {
  return RetryContext(
    baseUrl: request.baseUrl,
    path: request.path,
    method: request.method,
    contentType: request.contentType,
    params: Map<String, dynamic>.from(request.params ?? {}),
  );
}