gal パッケージは、デバイスの写真ギャラリーに画像や動画を保存する機能を提供し、組み込みの権限処理を備えたFlutterプラグインです。Android、iOS、macOS、Windowsをサポートしており、メディアエクスポート機能が必要なアプリに最適です。このプラグインは、権限を自動的に管理することでギャラリーへのアクセスプロセスを簡素化し、ボイラープレートコードを削減します。画像または動画のキャプチャ、編集、共有を含むマルチメディアワークフローにシームレスに統合できます。
[!WARNING]
Flutter currently has a fatal problem for loading info.plist, which may cause permission denials or app crashes in some code editors.
Windows Setup
Update Visual Studio to the latest version for using C++ 20.
[!TIP]
If you can't compile, try downloading the latest Windows SDK:
Open Visual Studio Installer
Select Modify
Select Windows SDK
Linux Setup
Linux is not officially supported, but can be added through a non-endorsed federated plugin.
See: gal_linux
💻 Usage
Save from Local
// Save Image (Supports two ways)awaitGal.putImage('$filePath');
awaitGal.putImageBytes('$uint8List');
// Save VideoawaitGal.putVideo('$filePath');
// Save to AlbumawaitGal.putImage('$filePath', album: '$album')
...