plux_media_picker 2.0.0 copy "plux_media_picker: ^2.0.0" to clipboard
plux_media_picker: ^2.0.0 copied to clipboard

A Flutter plugin that provides a unified API to pick photos, videos, and files from the device's gallery, camera, and file system.

2.0.0 #

Breaking changes

  • PluxFile.uri is now documented as an opaque handle. On Android it is still the platform uri; on iOS it is a token backed by a bookmark, which is what keeps a document readable.
  • copyToFile takes the PluxFile instead of a bare uri, so the copy can report the same source.
  • PluxFile.path and PluxFile.size are nullable: null means "no file on disk" and "the source did not report a size", which used to be indistinguishable from an empty path and an empty file.
  • PluxFile gained mimeType and type, both reported by the platform instead of guessed from the file name, and source, which says whether the camera, the gallery or the file manager produced it.
  • CameraMediaType was replaced by PluxMediaType (image, video, file), which also filters the gallery. CameraMediaType.any is gone: it only ever worked on iOS.
  • pickFile became pickFiles, returns a list and takes maxLimit, so several documents can be picked at once.
  • pickGallery takes an optional mediaType to show photos only or videos only, and asFile, which guarantees a PluxFile.path so a caller that needs a real file does not have to follow up with copyToFile per item.

Fixes

  • A document picked on iOS stays readable. The security scoped url was handed to Dart as a string and rebuilt later; a rebuilt url does not carry the sandbox extension, so anything outside the app container - iCloud Drive, another provider - could not be opened. The plugin now keeps a bookmark, taken while the scope is open, and resolves it on every read.
  • clearCache releases only the grants the plugin took, which it now records when picking a document. It used to walk every persisted uri permission the host app owned, including ones it knew nothing about, and it no longer wipes the state of a capture that is still in flight.
  • Decoding and re-encoding moved off the main thread. A multi-select of large photos ran the whole BitmapFactory round trip inside the ActivityResult callback, which is an ANR waiting to happen.
  • A gallery pick recovered by getLostFiles is readable again: the photo picker grant dies with the process, so the bytes are now taken before the result is stored. A recovered file also reports its source, so it can go back to the picker it came from.
  • A readFileStream session that is never listened to is dropped after a minute instead of holding its channel until the engine detaches, and the redundant probe read before every stream is gone.
  • iOS clamps quality and maxLimit the way Android does; maxLimit: 0 no longer means "unlimited" on one platform and "one item" on the other.
  • pickCamera on iOS checks that a camera exists and can no longer be entered twice while the permission prompt is up, which used to drop the first completion.
  • PluxMediaPickerException has a readable toString().

1.0.3 #

Fixes

  • Reading a file to the end no longer reports MissingPluginException(No implementation found for method cancel on channel ...fileStreamEvents.N). Flutter closes an event stream by sending a final cancel after endOfStream, and the channel was being torn down before that call could be answered. The session is now released when the subscription is cancelled, which covers both a completed read and an early cancellation. Affected every finished readFileStream on both platforms.

1.0.2 #

Breaking changes

  • getLostFiles now returns List<PluxFile> instead of List<File>, so a recovered result keeps its uri, name and size and can be read with readFileStream.
  • readFileStream takes an optional bufferSize (256 KB by default).
  • pickFile now throws PluxMediaPickerException on failure instead of returning null.
  • quality applies to images only: video is never re-encoded.
  • Removed the unused ImageSource enum.

Fewer copies

  • A file is copied only when it has to be re-encoded. Videos, documents and images picked at full quality are now returned as the original uri instead of being duplicated into the cache.
  • iOS opens documents in place (asCopy: false) rather than copying every pick into the app.
  • A camera capture is compressed in place, so it no longer leaves a second file behind.

Streaming

  • PluxFile.uri is now always set, so every picked file can be read with readFileStream, including gallery and camera results on iOS and recovered lost files.
  • Android reads on a background thread: the UI no longer freezes for the duration of the transfer, and cancelling a subscription actually stops the native reader.
  • Chunks in flight are bounded, so a fast disk cannot queue the whole file in memory.
  • Event channels are torn down when a stream ends, is cancelled or the engine detaches.

Fixes

  • Files with the same name no longer overwrite each other in the cache.
  • Compressed images are always written with a .jpg name instead of keeping the source extension.
  • Calling a picker while another call is pending fails the new call instead of leaving the previous Future unresolved forever.
  • Cancelling the camera or the file picker reports a cancellation instead of a save failure.
  • clearCache removes only the plugin's own files instead of the whole app cache.
  • The gallery no longer asks for a storage permission: the Android photo picker does not need one. pickGallery(maxLimit: 1) no longer hits the multi-select contract limit.
  • Fixed a data race while preparing several picked items on iOS, and the reported order now matches the order of selection.
  • Large images fall back to a downsampled decode instead of running out of memory.
  • iOS keeps the security scope open while measuring a file, and reports the actual failure code from the camera instead of a generic one.
  • Android takes a persistable grant for picked documents, so the uri survives a process restart.

1.0.1 #

  • Fixing Android bugs

1.0.0 #

  • A Flutter plugin that provides a unified API to pick photos, videos, and files from the device's gallery, camera, and file system.
0
likes
160
points
20
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that provides a unified API to pick photos, videos, and files from the device's gallery, camera, and file system.

Repository (GitHub)
View/report issues

Topics

#media #image-picker #file-picker #camera #gallery

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on plux_media_picker

Packages that implement plux_media_picker