copyWith method

Response<T> copyWith({
  1. Request? request,
  2. int? statusCode,
  3. Stream<List<int>>? bodyBytes,
  4. String? bodyString,
  5. String? statusText,
  6. Map<String, String>? headers,
  7. T? body,
})

Implementation

Response<T> copyWith({
  Request? request,
  int? statusCode,
  Stream<List<int>>? bodyBytes,
  String? bodyString,
  String? statusText,
  Map<String, String>? headers,
  T? body,
}) {
  return Response<T>(
    request: request ?? this.request,
    statusCode: statusCode ?? this.statusCode,
    bodyBytes: bodyBytes ?? this.bodyBytes,
    bodyString: bodyString ?? this.bodyString,
    statusText: statusText ?? this.statusText,
    headers: headers ?? this.headers,
    body: body ?? this.body,
  );
}