From d50243517cd17113f23403b83b47f790b1fd6558 Mon Sep 17 00:00:00 2001 From: ldementhon Date: Tue, 10 May 2022 16:37:24 -0700 Subject: [PATCH] Apply custom options after custom aspect ratio is set --- image_cropper/ios/Classes/FLTImageCropperPlugin.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image_cropper/ios/Classes/FLTImageCropperPlugin.m b/image_cropper/ios/Classes/FLTImageCropperPlugin.m index d7270932..1b03963c 100644 --- a/image_cropper/ios/Classes/FLTImageCropperPlugin.m +++ b/image_cropper/ios/Classes/FLTImageCropperPlugin.m @@ -73,8 +73,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { } cropViewController.allowedAspectRatios = allowedAspectRatios; - [self setupUiCustomizedOptions:call.arguments forViewController:cropViewController]; - if (ratioX != (id)[NSNull null] && ratioY != (id)[NSNull null]) { cropViewController.customAspectRatio = CGSizeMake([ratioX floatValue], [ratioY floatValue]); cropViewController.resetAspectRatioEnabled = NO; @@ -83,6 +81,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { cropViewController.aspectRatioLockEnabled = YES; } + [self setupUiCustomizedOptions:call.arguments forViewController:cropViewController]; + [[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:cropViewController animated:YES completion:nil]; } else { result(FlutterMethodNotImplemented);