Rodrigo

Missing arguments of copyWith

@@ -80,18 +80,14 @@ class Request<T> { @@ -80,18 +80,14 @@ class Request<T> {
80 String? method, 80 String? method,
81 Map<String, String>? headers, 81 Map<String, String>? headers,
82 Stream<List<int>>? bodyBytes, 82 Stream<List<int>>? bodyBytes,
83 - bool followRedirects = true,  
84 - int maxRedirects = 4, 83 + bool? followRedirects,
  84 + int? maxRedirects,
85 int? contentLength, 85 int? contentLength,
86 FormData? files, 86 FormData? files,
87 - bool persistentConnection = true, 87 + bool? persistentConnection,
88 Decoder<T>? decoder, 88 Decoder<T>? decoder,
89 bool appendHeader = true, 89 bool appendHeader = true,
90 }) { 90 }) {
91 - if (followRedirects) {  
92 - assert(maxRedirects > 0);  
93 - }  
94 -  
95 // If appendHeader is set to true, we will merge origin headers with that 91 // If appendHeader is set to true, we will merge origin headers with that
96 if (appendHeader && headers != null) { 92 if (appendHeader && headers != null) {
97 headers.addAll(this.headers); 93 headers.addAll(this.headers);
@@ -100,13 +96,13 @@ class Request<T> { @@ -100,13 +96,13 @@ class Request<T> {
100 return Request<T>._( 96 return Request<T>._(
101 url: url ?? this.url, 97 url: url ?? this.url,
102 method: method ?? this.method, 98 method: method ?? this.method,
103 - bodyBytes: bodyBytes ??= BodyBytesStream.fromBytes(const []), 99 + bodyBytes: bodyBytes ?? this.bodyBytes,
104 headers: headers == null ? this.headers : Map.from(headers), 100 headers: headers == null ? this.headers : Map.from(headers),
105 - followRedirects: followRedirects,  
106 - maxRedirects: maxRedirects, 101 + followRedirects: followRedirects ?? this.followRedirects,
  102 + maxRedirects: maxRedirects ?? this.maxRedirects,
107 contentLength: contentLength ?? this.contentLength, 103 contentLength: contentLength ?? this.contentLength,
108 files: files ?? this.files, 104 files: files ?? this.files,
109 - persistentConnection: persistentConnection, 105 + persistentConnection: persistentConnection ?? this.persistentConnection,
110 decoder: decoder ?? this.decoder, 106 decoder: decoder ?? this.decoder,
111 ); 107 );
112 } 108 }