http icon indicating copy to clipboard operation
http copied to clipboard

multipart request does not provide the correct progress

Open VikasRajbharGit opened this issue 3 years ago • 0 comments

final http.StreamedResponse response = await _client.send(request);
      int currProgress = 0;
      response.stream.listen((value) {
        currProgress += value.length;
        print(currProgress / contentLength);
      });

_client.send(request) awaits for the upload to finish and then after that it provides the StreamedResponse which has a stream but is of no use because the upload is finished and the stream is over, Whereas using request.finalize() gives an active stream but finishes quickly (within a second) even when the upload is not complete.

Can anyone please have a look into this or correct me if I am doing something wrong, Thanks.

VikasRajbharGit avatar Aug 08 '22 18:08 VikasRajbharGit