cropImageDoc static method
Implementation
static Future<File?> cropImageDoc() async {
final pickedImage = await ImagePicker().pickImage(source: ImageSource.gallery);
if (pickedImage != null) {
var croppedFile = await ImageCropper().cropImage(
sourcePath: pickedImage.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
],
);
if (croppedFile != null) {
return File(croppedFile.path);
}
}
return null;
}