We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ac84ef commit 945840eCopy full SHA for 945840e
pkgs/http/lib/src/io_client.dart
@@ -67,7 +67,24 @@ class IOClient extends BaseClient {
67
ioRequest.headers.set(name, value);
68
});
69
70
- var response = await stream.pipe(ioRequest) as HttpClientResponse;
+ HttpClientResponse response;
71
+ if (onSendProgress != null) {
72
+ var loaded = 0;
73
+ onSendProgress(loaded, request.contentLength);
74
+
75
+ await ioRequest.addStream(
76
+ stream.map(
77
+ (chunk) {
78
+ loaded += chunk.length;
79
80
+ return chunk;
81
+ },
82
+ ),
83
+ );
84
+ response = await ioRequest.close();
85
+ } else {
86
+ response = await stream.pipe(ioRequest) as HttpClientResponse;
87
+ }
88
89
var headers = <String, String>{};
90
response.headers.forEach((key, values) {
0 commit comments