easy_device_media

Easy Device Image Picker


License
BSD-3-Clause

Documentation

Features

  • Pick image from gallery, camera.
  • Support compress image.
  • Support crop image circle, rectangle.

Example

  DeviceMediaServiceImpl()
      .openPickImage(DeviceMediaSource.gallery,
          needCompress: true, needCrop: _useCrop)
      .then((value) {
    setState(() {
      image = value;
    });
  });

Native setup

Android

android:requestLegacyExternalStorage="true"

  <activity
    android:name="com.yalantis.ucrop.UCropActivity"
    android:screenOrientation="portrait"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

iOS

<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow $(APP_NAME) access to your photo library to upload your profile picture?</string>
<key>NSCameraUsageDescription</key>
<string>Allow $(APP_NAME) to take photo for sharing</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow $(APP_NAME) access to your photo library to upload your profile picture?</string>