copyWith method

DebugNetworkRequest copyWith({
  1. String? id,
  2. String? url,
  3. HttpMethod? method,
  4. Map<String, dynamic>? headers,
  5. dynamic body,
  6. DateTime? requestTime,
  7. int? statusCode,
  8. Map<String, dynamic>? responseHeaders,
  9. dynamic responseBody,
  10. DateTime? responseTime,
  11. int? durationMs,
  12. String? errorMessage,
  13. bool? isLoading,
})

Create a copy with updated values.

Implementation

DebugNetworkRequest copyWith({
  String? id,
  String? url,
  HttpMethod? method,
  Map<String, dynamic>? headers,
  dynamic body,
  DateTime? requestTime,
  int? statusCode,
  Map<String, dynamic>? responseHeaders,
  dynamic responseBody,
  DateTime? responseTime,
  int? durationMs,
  String? errorMessage,
  bool? isLoading,
}) {
  return DebugNetworkRequest(
    id: id ?? this.id,
    url: url ?? this.url,
    method: method ?? this.method,
    headers: headers ?? this.headers,
    body: body ?? this.body,
    requestTime: requestTime ?? this.requestTime,
    statusCode: statusCode ?? this.statusCode,
    responseHeaders: responseHeaders ?? this.responseHeaders,
    responseBody: responseBody ?? this.responseBody,
    responseTime: responseTime ?? this.responseTime,
    durationMs: durationMs ?? this.durationMs,
    errorMessage: errorMessage ?? this.errorMessage,
    isLoading: isLoading ?? this.isLoading,
  );
}