copyWith method

DeekWebPreparedRequest copyWith({
  1. String? method,
  2. Uri? uri,
  3. Map<String, String>? headers,
  4. List<int>? bodyBytes,
})

Unchanged data shares the existing immutable snapshot. New caller-owned headers or bytes are copied at this ownership boundary.

Implementation

DeekWebPreparedRequest copyWith(
        {String? method,
        Uri? uri,
        Map<String, String>? headers,
        List<int>? bodyBytes}) =>
    DeekWebPreparedRequest._(
      method ?? this.method,
      uri ?? this.uri,
      headers == null
          ? this.headers
          : UnmodifiableMapView(_HeaderMap(headers)),
      bodyBytes == null
          ? _bytes
          : Uint8List.fromList(bodyBytes).asUnmodifiableView(),
    );