getx
getx copied to clipboard
getx upload file is very slowly. like this bug #940.
ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION. Fill in the template. Issues that do not respect the model will be closed.
Describe the bug getx upload file is very slowly. like this bug #940.
when i use dio. it's fast.
**Reproduction code
example:
To Reproduce
Screenshots
Flutter Version:
Flutter 2.2.2 • channel stable Dart 2.13.3
Getx Version: get: ^4.1.4
Describe on which device you found the bug:
android 11
Minimal reproduce code final contentType = lookupMimeType(path); final formdata = FormData({"file":MultipartFile(path,filename: path.split('/').last,contentType: contentType!=null?contentType:"application/octet-stream"),"folder":folder} ); Result result = await cRequest('/admin/sys-file/upload/app',method: 'POST',data: formdata,uploadProgress: (val) async { if(uploadProgress == null) EasyLoading.showProgress(val/100,status: '${val.toStringAsFixed(0)}%'); else uploadProgress(val); });
You have to use multithreading for async/await post methods that have large multipart files attached to them.
This is to isolate the UI memory from post request process.
See the official video: https://www.youtube.com/watch?v=qrFTt1NZed8
I meet same issue, upload a image file 1.9 MB, UI freezing, and then upload failed.
I meet same issue, upload a image file 1.9 MB, UI freezing, and then upload failed.
Hey there, it sounds like your UI is freezing while using the post method for uploading files. Just a moment ago, I was facing the same issue. Then I removed the "uploadProgress" parameter from the post method. And now the UI is not freezing anymore. uploadProgress param has a glitch.
I meet same issue, upload a image file 1.9 MB, UI freezing, and then upload failed.
Hey there, it sounds like your UI is freezing while using the post method for uploading files. Just a moment ago, I was facing the same issue. Then I removed the "uploadProgress" parameter from the post method. And now the UI is not freezing anymore. uploadProgress param has a glitch.
I appreciate your helpful answer. Is there a way to use the uploadProgress parameter without any issues?
您必须对附加有大型多部分文件的 async/await post 方法使用多线程。
这是为了将 UI 内存与 post 请求过程隔离。
This operation should be encapsulated inside getConnect
您必须对附加有大型多部分文件的 async/await post 方法使用多线程。 这是为了将 UI 内存与 post 请求过程隔离。 观看官方视频:https://www.youtube.com/watch?v =qrFTt1NZed8
这个操作应该封装在getConnect里面
微任务队列被阻塞
I meet same issue, upload a image file 1.9 MB, UI freezing, and then upload failed.
Hey there, it sounds like your UI is freezing while using the post method for uploading files. Just a moment ago, I was facing the same issue. Then I removed the "uploadProgress" parameter from the post method. And now the UI is not freezing anymore. uploadProgress param has a glitch.
use dio 😭