DynamicImageCrop.fromFile constructor

DynamicImageCrop.fromFile({
  1. required File imageFile,
  2. required CropController controller,
  3. required void onResult(
    1. Uint8List resultImage,
    2. int width,
    3. int height
    ),
  4. ImageByteFormat? imageByteFormat,
  5. Color? cropLineColor,
  6. double? cropLineWidth,
  7. Key? key,
})

Input image as File.

Declare CropController variable and input it to control this Widget.

onResult is a callback function that returns the cropped image, width, and height.

Implementation

DynamicImageCrop.fromFile({
  required File imageFile,
  required this.controller,
  required this.onResult,
  this.imageByteFormat,
  this.cropLineColor,
  this.cropLineWidth,
  super.key,
}) : image = imageFile.readAsBytesSync();