gal
3.0.1, released 6 days ago by midoridesign.studio
Save images and videos to the device gallery with a single call and built‑in permission handling.
What it does
The package provides static methods to write image or video files (or raw bytes) into the user's photo library on Android, iOS, macOS, and Windows. It also offers helpers to check and request the required storage permissions.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to store media captured or downloaded by the app into the user's gallery.
- You want a simple API that abstracts platform‑specific permission and album handling.
Skip it when
- You require fine‑grained control over media metadata beyond what the plugin offers.
- You need cross‑platform support for Linux (only available via a separate community plugin).
Strengths
- Very small and easy‑to‑use API.
- Handles permissions automatically.
- Supports saving to named albums and preserves metadata.
Weaknesses
- Linux not officially supported (requires extra plugin).
- Limited to saving media; does not provide picking or editing capabilities.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Add platform‑specific permission keys to iOS/macOS Info.plist and WRITE_EXTERNAL_STORAGE permission to AndroidManifest.xml; Windows may need latest Visual Studio/C++20 toolchain.
import 'package:gal/gal.dart';
await Gal.putImage('/path/to/image.jpg');
await Gal.putVideo('/path/to/video.mp4');
await Gal.hasPermission();
await Gal.requestPermission();Alternatives
Packages that do the same job and could replace gal.
- file_saver_ffi
Save any file type to device storage, gallery, or a user‑chosen folder with progress and conflict handling.
76Compare - image_downloader
Download internet images and media files and save them to device storage.
48Compare
Works with
Packages commonly used together with gal: ones it builds on, ones built on it, and its own family.