-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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:
- on Android, it makes an internal call to saf_stream and returns this stream
- on iOS and MacOS, it returns a custom stream which:
- on first read it makes a call to
startAccessingSecurityScopedResourceWithURL(uri), and continues streaming the file viaFile(path).openRead() - on close, it makes a call to
stopAccessingSecurityScopedResourceWithURL(uri)
- on first read it makes a call to
- on Web: some inspiration can be taken from
file_picker, which seems to make great use ofArrayBufferto convert the file to a readable stream - on Windows/Linux: there would be no particular limits from simply using
File(path).openRead().
Metadata
Metadata
Assignees
Labels
No labels