copyWith method
Creates a copy of this response with optional modifications.
Implementation
ClientResponse copyWith({
int? statusCode,
String? body,
List<int>? bodyBytes,
Map<String, String>? headers,
String? requestUrl,
String? method,
int? requestDuration,
bool? isFromCache,
}) {
return ClientResponse(
statusCode: statusCode ?? this.statusCode,
body: body ?? this.body,
bodyBytes: bodyBytes ?? this.bodyBytes,
headers: headers ?? this.headers,
requestUrl: requestUrl ?? this.requestUrl,
method: method ?? this.method,
requestDuration: requestDuration ?? this.requestDuration,
isFromCache: isFromCache ?? this.isFromCache,
);
}