cropImage static method

Future<File> cropImage({
  1. required File image,
  2. required int originX,
  3. required int originY,
  4. required int width,
  5. required int height,
})

Crops an image

Crops the given image. originX and originY control from where the image should be cropped. width and height control how the image is being cropped.

Implementation

static Future<File> cropImage({
  required File image,
  required int originX,
  required int originY,
  required int width,
  required int height,
}) async {
  final compressedFile = await FlutterNativeImage.cropImage(
    image.absolute.path,
    originX,
    originY,
    width,
    height,
  );

  return compressedFile;
}