cropImage static method

Future<CroppedFile> cropImage(
  1. dynamic pickedImage,
  2. dynamic context, {
  3. dynamic toolbarColor,
})

add below code in manifiest in android

Implementation

static Future<CroppedFile> cropImage(pickedImage,context,{toolbarColor}) async {
  CroppedFile? cropImage;
  if (pickedImage != null) {
    final croppedFile = await ImageCropper().cropImage(
      sourcePath: pickedImage!.path,
      compressFormat: ImageCompressFormat.jpg,
      compressQuality: 100,
      uiSettings: [
        AndroidUiSettings(
            toolbarTitle: 'Cropper',
            toolbarColor:toolbarColor??CommonColors.primaryColor,
            toolbarWidgetColor: Colors.white,
            initAspectRatio: CropAspectRatioPreset.original,
            lockAspectRatio: false),
        IOSUiSettings(
          title: 'Cropper',
        ),
        WebUiSettings(
          context: context,
          presentStyle: CropperPresentStyle.dialog,
          boundary: const CroppieBoundary(
            width: 520,
            height: 520,
          ),
          viewPort:
          const CroppieViewPort(width: 480, height: 480, type: 'circle'),
          enableExif: true,
          enableZoom: true,
          showZoomer: true,
        ),
      ],
    );
    if (croppedFile != null) {
      cropImage = croppedFile;

    // return cropImage;
    }
  }
  return cropImage!;
}