cropImage static method
Future
cropImage(
- dynamic imageFile
)
Implementation
static Future cropImage(imageFile) async {
CroppedFile? croppedFile = await ImageCropper().cropImage(
sourcePath: imageFile.path,
uiSettings: [
AndroidUiSettings(
toolbarTitle: 'Cropper',
toolbarColor: CommonColors.theme,
toolbarWidgetColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
aspectRatioPresets: [
CropAspectRatioPreset.original,
CropAspectRatioPreset.square,
],
lockAspectRatio: false),
IOSUiSettings(
title: 'Cropper',
aspectRatioPresets: [
CropAspectRatioPreset.original,
CropAspectRatioPreset.square,
],
),
WebUiSettings(
context: Get.context!,
),
],
);
var res = await OssHelper.upload(file: File(croppedFile!.path));
return res;
}