copyWith<NewBodyType> method

GoogleHTTPResponse<NewBodyType> copyWith<NewBodyType>({
  1. BaseResponse? base,
  2. NewBodyType? body,
  3. GoogleErrorResponse? error,
})

Makes a copy of this Response, replacing original values with the given ones. This method can also alter the type of the response body.

Implementation

GoogleHTTPResponse<NewBodyType> copyWith<NewBodyType>({
  http.BaseResponse? base,
  NewBodyType? body,
  GoogleErrorResponse? error,
}) => GoogleHTTPResponse<NewBodyType>(
  base ?? this.base,
  body ?? (this.body as NewBodyType),
  error: error ?? this.error,
);