copyWith method Null safety
Create a new copy of request object.
Implementation
Request copyWith({
Uri? uri,
Duration? timeout,
String? method,
Map<String, String>? headers,
List<int>? bodyBytes,
ResponseType? responseType,
ValidateCallback? validateStatus,
void Function(int total, int current)? onDownloadProgress,
}) {
return Request(
uri: uri ?? this.uri,
validateStatus: validateStatus ?? this.validateStatus,
timeout: timeout ?? this.timeout,
method: method ?? this.method,
headers: headers ?? this.headers,
bodyBytes: bodyBytes ?? this.bodyBytes,
responseType: responseType ?? this.responseType,
onDownloadProgress: onDownloadProgress ?? this.onDownloadProgress,
);
}