Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for
download
function in web #2230base: main
Are you sure you want to change the base?
Add support for
download
function in web #2230Changes from 17 commits
c429be1
7147d04
6e5a96b
4dec223
3853fc9
7cf567f
0b1fbe6
77c63b8
7bc44a1
cf1c52d
1bbc7f9
9db2305
5917273
d029294
9f1f36e
4507ef2
a71f76f
5fda084
13369e1
d77d692
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will the result be after downloaded? Could you demonstrate how it works?
EDIT: Please also add an example somewhere in our examples so everyone can run and see how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an example in
example_flutter_app
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To test on the local web, make sure CORS is disabled.
and use local
dio
anddio_web_adapter
in example_flutter_app pubspecThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why CORS is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To download a file from an online server to a local server, the browser gives a CORS error. This has nothing to do with Dio. I said this for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, how about a local server to scope with the minimal functionality instead of an outer source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to put a file locally? If we do this, the download display will be very fast and the download percentage will not be clearly visible.
Are you sure about this? This is just an example to demonstrate a feature 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A demo would not require displaying the progress, correct? The file could be as small as possible too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are some examples for pure Dart
dio/dio_test/lib/src/test/download_tests.dart
Line 94 in 0b0f527
Just need to run it on the web.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexV525