hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image_cropper package in flutter lockAspectRatio: true, not working in ios app but android workking fine

vijayulektz opened this issue · comments

my code
await ImageCropper().cropImage(
sourcePath: image.path,
aspectRatioPresets: [
CropAspectRatioPreset.square
],
uiSettings: [
AndroidUiSettings(
lockAspectRatio: true),
IOSUiSettings(
resetAspectRatioEnabled:false,
aspectRatioLockEnabled: true,
)
],
)

i want ios app user can't change aspect ratio size in image croper

@vijayulektz

Try this one!

await ImageCropper().cropImage(
sourcePath: image.path,
+ aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), // your aspect ratio
aspectRatioPresets: [
CropAspectRatioPreset.square
],
uiSettings: [
AndroidUiSettings(
lockAspectRatio: true),
IOSUiSettings(
resetAspectRatioEnabled:false,
aspectRatioLockEnabled: true,
)
],
)

@vijayulektz facing the same issue. Have u find any solution ?