Open xyzbilal opened 3 years ago
We need receive progress. Forced to use dio in pair with GetConnect only because download progress is necessary in large request cases. And you never know then you will have to download something in development cycle of you app. Without onReceiveProgress, you will always have to use dio in any case you need something to fetch bigger then 5mb~. And its not you always want to do when you have your API's configured with auth + interceptors + serializers + nice looking requests in GetConnect. Distracting. P.S. I like getx infrastructure, best what I have found in flutter after 1 year commercial development.
so we have to use dio to download ?
yes, need download action
I'm simply using an alternative solution with url launcher to download files, very simple and quick to implement
if (await launchUrl(Uri.parse(downloadUrl),
mode: LaunchMode.externalApplication)) {
} else {
...
}
Hi, I am trying to download an image from network but I am getting error that stream is already listened to. my function is
error ;
I also tried like this
file.writeAsBytesSync(response.bodyBytes);
and of course it gives the error of;also I tried,
and get the same error that says
Unhandled Exception: Bad state: Stream has already been listened to.
I was running this with http package like below ;
when I check bodyBytes in http package it defined as
Uint8List that implements List<int>
but bodyBytes in your package is extendsextends StreamView<List<int>>
I also use download method of dio package likebelow;
this method directly saves files to filepath and with File widget I can show my downloaded image. also showing download progress is also nice feature. I tried to implement this to your codes but I could not success. I guess I am not professional enough for this area. It would great if Get connect also has this kind of features. thanks for your efforts.