-
Notifications
You must be signed in to change notification settings - Fork 0
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
Question: Why not embrace the usage of read streams? #1
Comments
there could also be a method to convert it to a http.MultipartFile, which would have the sole difference of creating the MultipartFile from a stream on IO platforms, and from the HTML file on Web (which would take off some overhead). |
Thanks for the feedback. Some functionalities (like picking files on windows / linux, or picking save paths) never need to copy files. In these cases, I agree the example looks a bit verbose. So why not adding more packages for a simpler API? The reason is single-responsibility principle, this package is only responsible to show a picker and return OS file paths. It's users' choice to use whatever packages to consume the returned OS paths. There might other packages better than Web support is on todo list. |
Why don't you make this wrapper public? I think that a decent public API will make this package way more usable rather than something like You could make a package fast_file_picker_internal and wrap that over in this fast_file_picker package so that the user can use the public API with the defaults, and in case they want to change some behaviour, they can either make their own fork, or reimplement the logic entirely. Anyways, to be clear, I don't pretend you make something like this, it's just an idea for a better file picker, since it would be very unique compared to other packages. |
The problem is there is always friction on each platforms. Let's say we incorporate |
Hi! I'm very interested in this package since it's the first time that I'm noticing a file picker which actually exports a stream (via saf_stream on Android) instead of copying the file to a temporary location.
I was wondering, why not drop
file_selector
entirely, and make it easier to access the read streams on the public APIs, and keep the usage of packages like saf_stream entirely on the backend?For example, there could be a method
file.openRead()
, which takes these actions:startAccessingSecurityScopedResourceWithURL(uri)
, and continues streaming the file viaFile(path).openRead()
stopAccessingSecurityScopedResourceWithURL(uri)
file_picker
, which seems to make great use ofArrayBuffer
to convert the file to a readable streamFile(path).openRead()
.The text was updated successfully, but these errors were encountered: