r/FlutterDev • u/One_Yogurtcloset_910 • 2d ago
Plugin I built an Adaptive Image Picker for Flutter: Zero-permission PhotoPicker + Pure-Dart Cropping & Binary Search Compression
Hey Flutter community! 👋
In almost every production Flutter app, handling image picking usually requires stringing together 2–3 different packages (image_picker, image_cropper, and a compression plugin), managing invasive storage permissions on Android/iOS, and dealing with native build issues (like UCrop pod conflicts on iOS/Android).
To solve this, I built adaptive_image_picker — a lightweight, unified, zero-permission media pipeline.
✨ Key Features:
- 🔒 Zero Permissions by Default: Native integration with Android 13+ Photo Picker (
PickVisualMedia) and iOS 14+PHPickerViewController. NoREAD_EXTERNAL_STORAGEneeded. - ✂️ Pure-Dart Cropper: No native UI wrappers (like UCrop). Supports freeform cropping, aspect ratio presets, 90° rotation, horizontal/vertical flipping, and antialiased circular avatar masking.
- ⚡ Binary Search Target-Size Compression: Automatically compresses images to guarantee a file size ≤≤
maxBytes(e.g. max 500 KB) without manual guessing. - 🎨 Adaptive Native UI: Automatically renders Material 3 bottom sheets on Android, Cupertino action sheets on iOS, and modal dialogs on Web/Desktop.
- 🌐 Full Web & WASM Compatibility: Zero native desktop/web crashes.
- 🔗 Direct URL Import: Built-in network downloader integrated right into the picker pipeline.
📦 Pub.dev: https://pub.dev/packages/adaptive_image_picker
💻 GitHub: https://github.com/Karan8686/adaptive_image_picker
Would love your feedback, feature suggestions, or issue reports!
1
u/zemega 2d ago
I'm sold on this idea. Going to test. What about Windows support?
1
u/One_Yogurtcloset_910 2d ago
Thanks for checking it out! Right now, all the cropping, compression, and image processing run on pure Dart, so they work great on Windows. Native Windows file dialog picking is in the works for the next update so you can pick straight from File Explorer. Let me know how your testing goes and if you run into anything!
1
1
u/GeekyAntsFlutterdev 21h ago
Went through the repo and I like that this solves the actual workflow instead of adding unnecessary abstraction. One thing I’d be curious about is how it behaves once the project gets larger, especially around error handling and edge cases. Would be interesting to see some real-world examples added to the README.
1
u/One_Yogurtcloset_910 21h ago
Thanks, appreciate that! Good question on scaling.
Right now edge-case handling covers things like permission denials, unsupported formats, and cancelled picks — but I haven't pushed it hard on larger projects with things like very large files, multi-select at scale, or picking from unusual sources (cloud-backed gallery apps etc.), so there's likely room to tighten up around size/type validation and clearer error states there rather than a single generic failure.
Real-world examples in the README is a solid idea — I'll add a few covering common edge cases (large file rejection, permission denied flow, multi-select) so it's clearer how it behaves beyond the basic usage snippet. Will follow up here once that's in.
5
u/ich3ckmat3 1d ago
Any visual stuff should include screenshots