Untitled
unknown
dart
3 years ago
790 B
12
Indexable
Future<File?> cropImage(File file) async {
File? newFile;
CroppedFile? cropped = await ImageCropper().cropImage(
sourcePath: file.path,
compressQuality: 10,
cropStyle: CropStyle.rectangle,
compressFormat: ImageCompressFormat.jpg,
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
uiSettings: [
AndroidUiSettings(
toolbarColor: Get.theme.primaryColor,
toolbarTitle: 'Crop Image',
statusBarColor: AppColors.white,
backgroundColor: AppColors.white,
activeControlsWidgetColor: Get.theme.focusColor,
),
IOSUiSettings(
title: 'Cropper',
),
],
);
if (cropped != null) {
newFile = File(cropped.path);
}
return newFile;
}Editor is loading...