image_picker_type 1.0.1 copy "image_picker_type: ^1.0.1" to clipboard
image_picker_type: ^1.0.1 copied to clipboard

outdated

A Flutter plugin for iOS and Android for picking images from the image library and crop it.

image_picker_type plugin for Flutter #

A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera or gallery and crop it.

Features #

  • iOS Support
  • Android Support

Installation #

First, add image_picker_type.

iOS #

Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

  • NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
  • NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.
  • NSMicrophoneUsageDescription - describe why your app needs access to the microphone, if you intend to record videos. This is called Privacy - Microphone Usage Description in the visual editor.

Android #

  • Add UCropActivity into your AndroidManifest.xml
<activity
    android:name="com.yalantis.ucrop.UCropActivity"
    android:screenOrientation="portrait"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

Note:

From v1.2.0, you need to migrate your android project to v2 embedding (detail)

API 29+

No configuration required - the plugin should work out of the box.

API < 29

Add android:requestLegacyExternalStorage="true" as an attribute to the <application> tag in AndroidManifest.xml. The attribute is false by default on apps targeting Android Q.

Example #

// show bottom sheet to select image option
showModalBottomSheet<void>(
    context: context,
    builder: (BuildContext context) {
      return ImagePickerHelper(
        size: Size(300, 300),
        onDone: (file) {
          if (file == null) {
            print(null);
          } else {
           setState(() {
                 File file = file;
            });
          }
        },
      );
    });

example

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

15
likes
0
pub points
76%
popularity

Publisher

unverified uploader

A Flutter plugin for iOS and Android for picking images from the image library and crop it.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, image_cropper, image_picker

More

Packages that depend on image_picker_type