simple_image_crop

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

simple image crop

Image Zoom and Cropping plugin for Flutter #
A simple and easy used flutter plugin to crop image on iOS and Android.




Installation #
Add simple_image_crop as a dependency in pubspec.yaml.
Using #
Create a widget to load and edit an image: #

image can be of any type:

ImgCrop(...), // ImageProvider
ImgCrop.file(...) // Image file
ImgCrop.asset(...) // Image assets your local
copied to clipboard
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: FileImage(imageFile), // you selected image file
),
);
}
copied to clipboard
Generate a cropped image: #

a async function get cropped file image:


croppedImage is you cropped image File
pictureQuality Can control image size and quality

final croppedFile = await crop.cropCompleted(
croppedImage,
{pictureQuality: 900}
)
copied to clipboard
floatingActionButton: FloatingActionButton(
onPressed: () async {
final crop = cropKey.currentState;
final croppedFile =
await crop.cropCompleted(args['image'], pictureQuality: 900);

// show you croppedFile ……
showImage(context, croppedFile);
},
copied to clipboard
it's so esay !

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator