Introducing Magic Picker 1.0.1
Pick a file, get a MagicFile back.
A Pick facade for apps on the Magic framework: open the gallery, the camera, the file dialog and the save dialog, and get a MagicFile from the pickers.
Pick, save and share files.
The Pick facade opens the gallery, the camera, the file dialog and the save dialog. It covers Android, iOS, web, macOS, Windows and Linux, with two exceptions listed below.
-
Gallery picks
Learn more about Gallery picksPick.image,Pick.images,Pick.mediaandPick.videoopen the gallery and return aMagicFile;Pick.imagesreturns an empty list on cancel. -
Camera capture
Learn more about Camera capturePick.cameraandPick.recordVideotake afallbackToGalleryoption and anonErrorcallback. On desktop the camera needs a customimage_pickerdelegate. -
System file dialog
Learn more about System file dialogPick.file,Pick.filesandPick.directoryopen the system file dialog, with an optionalextensionsfilter.Pick.directoryreturns a path and is not on the web. -
Save dialog
Learn more about Save dialogPick.saveFileopens the save dialog and returns aUri?: schemefileon desktop and iOS,contenton Android,blobon the web. -
Convert both ways
Learn more about Convert both waysXFile.toMagicFile()andMagicFile.toXFile()convert both ways. Bytes are read lazily throughbytesReader; on the webtoXFileis asynchronous. -
Share sheet downloads
Learn more about Share sheet downloadsPickerServiceProvidersets the download handler, soStorage.downloadopens the share sheet on mobile and desktop. On the web a download starts in the browser.
Add it in seconds
Or add to pubspec.yaml:
dependencies:
magic_picker: ^1.0.1
Or give your AI agent this prompt: