Committed by
GitHub
Merge pull request #1804 from rodrigorahman/master
bugfix copyWith parametters missing
Showing
1 changed file
with
5 additions
and
5 deletions
@@ -75,7 +75,7 @@ class Request<T> { | @@ -75,7 +75,7 @@ class Request<T> { | ||
75 | ); | 75 | ); |
76 | } | 76 | } |
77 | 77 | ||
78 | - Request copyWith({ | 78 | + Request<T> copyWith({ |
79 | Uri? url, | 79 | Uri? url, |
80 | String? method, | 80 | String? method, |
81 | Map<String, String>? headers, | 81 | Map<String, String>? headers, |
@@ -97,17 +97,17 @@ class Request<T> { | @@ -97,17 +97,17 @@ class Request<T> { | ||
97 | headers.addAll(this.headers); | 97 | headers.addAll(this.headers); |
98 | } | 98 | } |
99 | 99 | ||
100 | - return Request._( | 100 | + return Request<T>._( |
101 | url: url ?? this.url, | 101 | url: url ?? this.url, |
102 | method: method ?? this.method, | 102 | method: method ?? this.method, |
103 | bodyBytes: bodyBytes ??= BodyBytesStream.fromBytes(const []), | 103 | bodyBytes: bodyBytes ??= BodyBytesStream.fromBytes(const []), |
104 | headers: headers == null ? this.headers : Map.from(headers), | 104 | headers: headers == null ? this.headers : Map.from(headers), |
105 | followRedirects: followRedirects, | 105 | followRedirects: followRedirects, |
106 | maxRedirects: maxRedirects, | 106 | maxRedirects: maxRedirects, |
107 | - contentLength: contentLength, | ||
108 | - files: files, | 107 | + contentLength: contentLength ?? this.contentLength, |
108 | + files: files ?? this.files, | ||
109 | persistentConnection: persistentConnection, | 109 | persistentConnection: persistentConnection, |
110 | - decoder: decoder, | 110 | + decoder: decoder ?? this.decoder, |
111 | ); | 111 | ); |
112 | } | 112 | } |
113 | } | 113 | } |
-
Please register or login to post a comment