'crop ratio getting changed when expanding crop area in image_cropper flutter
How to lock aspect ratio when 1:1,4:3 or 16:9 crop aspect ratio select. When original ratio selected make aspect ratio unlock.
It is working proper in iOS, But getting issue in android platform.
Here is code I have used.
val = (await ImageCropper.cropImage(
sourcePath: pickedFile!.path,
compressQuality: 100,
maxHeight: 700,
maxWidth: 700,
compressFormat: ImageCompressFormat.jpg,
androidUiSettings: AndroidUiSettings(
toolbarColor: ColorConstants.primaryColor,
toolbarWidgetColor: ColorConstants.customBlackColor,
lockAspectRatio: false,
toolbarTitle: "Wood",
activeControlsWidgetColor: ColorConstants.primaryColor),
iosUiSettings: IOSUiSettings(
resetButtonHidden: false,
aspectRatioLockEnabled: false,
rotateButtonsHidden: false,
rotateClockwiseButtonHidden: false)))!;
Solution 1:[1]
For android you need to set the lockAspectRatio to true. This is the default value. You set it to false.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Abhishek Dutt |
