FLUTTER ECOSYSTEM

Samoy/image_save

Save image to album or sandbox

image_save project cover
Stars
23
Forks
28
Last push (UTC)
Dec 3, 2021
Project status
Active
Samoy GitHub avatar
GITHUB User

Samoy ↗

Zhengzhou,ChinaOfficial website ↗
LanguagesJavaObjective-CDartRuby

Technical topics

Packages published by this repository

Dependencies used

Dependency list 3 items
  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}
  • dioDevelopment4.0.0

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

image_save

version platform starts

Save image to album, support Android and iOS.

Permission

  • Android

Add the following statement in AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  • iOS

Add the following statement in Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>Add the description of the permission you need here.</string>

Usage

See Example

// Save to album.
bool success = await ImageSave.saveImage(data, "demo.gif", albumName: "demo");

// Save to sandbox.
// Notice: Image saved in this way will be deleted when the application is uninstalled.
bool success = await ImageSave.saveImageToSandbox(data, "demo.gif");

// Get images from Sandbox.
List<Uint8List> imageDatas = await ImageSave.getImagesFromSandbox();