copyWith method

HTTPResponseData copyWith({
  1. Map<String, dynamic>? headers,
  2. int? statusCode,
  3. DataType? data,
  4. String? statusMessage,
  5. String? error,
})

Creates a copy of this HTTPResponseData with the given parameters, allowing for modification of certain fields while keeping others from the original object.

Implementation

HTTPResponseData copyWith({
  Map<String, dynamic>? headers,
  int? statusCode,
  DataType? data,
  String? statusMessage,
  String? error,
}) {
  return HTTPResponseData(
    headers: headers ?? this.headers,
    statusCode: statusCode ?? this.statusCode,
    data: data ?? this.data,
    statusMessage: statusMessage ?? this.statusMessage,
    error: error ?? this.error,
  );
}