simple_image_crop 0.1.2 copy "simple_image_crop: ^0.1.2" to clipboard
simple_image_crop: ^0.1.2 copied to clipboard

outdated

A simple and easy to use flutter plugin to crop image on iOS and Android.

Image Zoom and Cropping plugin for Flutter #

A simple and easy used flutter plugin to crop image on iOS and Android.

Image Cropping circle area Image Cropping rect area Image Cropping rect gif Image Cropping area gif

Installation #

Add simple_image_crop simple_image_crop as a dependency in pubspec.yaml.

Using #

Create a widget to load and edit an image: #

final imgCropKey = GlobalKey<ImgCropState>();

Widget _buildCropImage() {
  return Container(
      color: Colors.black,
      child: ImgCrop(
        key: cropKey,
        chipRadius: 150,  // crop area radius
        chipShape: 'circle', // crop type "circle" or "rect"
        image: Image.file(imageFile), // you selected image file
      ),
  );
}

Generate a cropped image: #

Select image recommend image-picker, image file may be from the previous page:

final Map args = ModalRoute.of(context).settings.arguments

a async function get cropped file image:

final croppedFile = crop.cropCompleted('selected file image', {pictureQuality: 'int of Picture quality'})
floatingActionButton: FloatingActionButton(
  onPressed: () async {
    final crop = cropKey.currentState;
    final croppedFile =
        await crop.cropCompleted(args['image'], pictureQuality: 900);

    // show you croppedFile ……
    showImage(context, croppedFile);
  },

it's so esay !

52
likes
0
pub points
65%
popularity

Publisher

unverified uploader

A simple and easy to use flutter plugin to crop image on iOS and Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on simple_image_crop