From f6ea193af2c8a3439c78629f16d02c3d18914d76 Mon Sep 17 00:00:00 2001 From: Tihomirov Date: Tue, 5 Oct 2021 17:12:44 +0300 Subject: [PATCH] Calling the function with passing the parameters of the width and height of the scanning area for IOS --- ios/Classes/QRView.swift | 3 ++- lib/src/qr_code_scanner.dart | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ios/Classes/QRView.swift b/ios/Classes/QRView.swift index ac6931e..5300af5 100644 --- a/ios/Classes/QRView.swift +++ b/ios/Classes/QRView.swift @@ -56,7 +56,8 @@ public class QRView:NSObject,FlutterPlatformView { self?.setDimensions(result, width: arguments["width"] ?? 0, height: arguments["height"] ?? 0, - scanArea: arguments["scanArea"] ?? 0, + scanArea: arguments["scanAreaWidth"] ?? 0, + scanArea: arguments["scanAreaHeight"] ?? 0, scanAreaOffset: arguments["scanAreaOffset"] ?? 0) case "startScan": self?.startScan(call.arguments as! Array, result) diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index a194395..238529c 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -334,7 +334,8 @@ class QRViewController { await channel.invokeMethod('setDimensions', { 'width': renderBox.size.width, 'height': renderBox.size.height, - 'scanArea': overlay?.cutOutWidth ?? 0, //Todo + 'scanAreaWidth': overlay?.cutOutWidth ?? 0, + 'scanAreaHeight': overlay?.cutOutHeight ?? 0, 'scanAreaOffset': overlay?.cutOutBottomOffset ?? 0 }); return true;