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 f7278d9 commit 9247301Copy full SHA for 9247301
lib/src/io_client.dart
@@ -40,7 +40,24 @@ class IOClient extends BaseClient {
40
ioRequest.headers.set(name, value);
41
});
42
43
- var response = await stream.pipe(ioRequest) as HttpClientResponse;
+ HttpClientResponse response;
44
+ if (onSendProgress != null) {
45
+ var loaded = 0;
46
+ onSendProgress(loaded, request.contentLength);
47
+
48
+ await ioRequest.addStream(
49
+ stream.map(
50
+ (chunk) {
51
+ loaded += chunk.length;
52
53
+ return chunk;
54
+ },
55
+ ),
56
+ );
57
+ response = await ioRequest.close();
58
+ } else {
59
+ response = await stream.pipe(ioRequest) as HttpClientResponse;
60
+ }
61
62
var headers = <String, String>{};
63
response.headers.forEach((key, values) {
0 commit comments