From d3a90f721fa6a1fbc74d101c2ad37e655e9499fb Mon Sep 17 00:00:00 2001 From: Alexander Tihomirov <56314363+OrangeSofter@users.noreply.github.com> Date: Wed, 28 Jul 2021 12:05:32 +0300 Subject: [PATCH 1/8] Temporary replacement of BarcodeView with DecoratedBarcodeView in order to see the real boundaries of the scanned area --- .../net/touchcapture/qr/flutterqr/QRView.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index 6875675..3871682 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -13,6 +13,7 @@ import com.google.zxing.ResultPoint import com.journeyapps.barcodescanner.BarcodeCallback import com.journeyapps.barcodescanner.BarcodeResult import com.journeyapps.barcodescanner.BarcodeView +import com.journeyapps.barcodescanner.DecoratedBarcodeView import io.flutter.plugin.common.BinaryMessenger import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel @@ -25,7 +26,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: private var isTorchOn: Boolean = false private var isPaused: Boolean = false - private var barcodeView: BarcodeView? = null + private var barcodeView: DecoratedBarcodeView? = null private val channel: MethodChannel = MethodChannel(messenger, "net.touchcapture.qr.flutterqr/qrview_$id") private var permissionGranted: Boolean = false @@ -132,7 +133,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } if (hasFlash()) { - barcodeView!!.setTorch(!isTorchOn) + barcodeView!!.barcodeView.setTorch(!isTorchOn) isTorchOn = !isTorchOn result.success(isTorchOn) } else { @@ -145,7 +146,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: if (barcodeView == null) { return barCodeViewNotSet(result) } else { - if (barcodeView!!.isPreviewActive) { + if (barcodeView!!.barcodeView.isPreviewActive) { isPaused = true barcodeView!!.pause() } @@ -157,7 +158,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: if (barcodeView == null) { return barCodeViewNotSet(result) } else { - if (!barcodeView!!.isPreviewActive) { + if (!barcodeView!!.barcodeView.isPreviewActive) { isPaused = false barcodeView!!.resume() } @@ -190,9 +191,9 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: return initBarCodeView().apply {}!! } - private fun initBarCodeView(): BarcodeView? { + private fun initBarCodeView(): DecoratedBarcodeView? { if (barcodeView == null) { - barcodeView = BarcodeView(Shared.activity) + barcodeView = DecoratedBarcodeView(Shared.activity) if (params["cameraFacing"] as Int == 1) { barcodeView?.cameraSettings?.requestedCameraId = CameraInfo.CAMERA_FACING_FRONT } @@ -233,7 +234,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } private fun stopScan() { - barcodeView?.stopDecoding() + barcodeView?.barcodeView?.stopDecoding() } private fun getSystemFeatures(result: MethodChannel.Result) { From fd2a7abf8ee7889ab6b1fb922fe9633242822b76 Mon Sep 17 00:00:00 2001 From: Alexander Tihomirov <56314363+OrangeSofter@users.noreply.github.com> Date: Wed, 28 Jul 2021 12:27:58 +0300 Subject: [PATCH 2/8] ChangeScanAreaSize android function --- .../kotlin/net/touchcapture/qr/flutterqr/QRView.kt | 13 +++++++++++++ lib/src/qr_code_scanner.dart | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index 3871682..d741286 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -15,6 +15,7 @@ import com.journeyapps.barcodescanner.BarcodeResult import com.journeyapps.barcodescanner.BarcodeView import com.journeyapps.barcodescanner.DecoratedBarcodeView import io.flutter.plugin.common.BinaryMessenger +import com.journeyapps.barcodescanner.Size import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.PluginRegistry @@ -89,6 +90,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: "getCameraInfo" -> getCameraInfo(result) "getFlashInfo" -> getFlashInfo(result) "getSystemFeatures" -> getSystemFeatures(result) + "changeScanArea" -> changeScanArea(call.arguments as Double, result) else -> result.notImplemented() } } @@ -247,6 +249,17 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } } + private fun changeScanArea(newSize: Double, result: MethodChannel.Result) { + setScanAreaSize(newSize, newSize) + result.success(true) + } + + private fun setScanAreaSize(dpScanAreaWidth: Double, dpScanAreaHeight: Double) { + barcodeView?.barcodeView?.framingRectSize = Size(convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight)) + } + + private fun convertDpToPixels(dp: Double) = (dp * barcodeView!!.context.resources.displayMetrics.density).toInt() + private fun hasCameraPermission(): Boolean { return permissionGranted || Build.VERSION.SDK_INT < Build.VERSION_CODES.M || diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index 2010755..fb8f799 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -341,6 +341,14 @@ class QRViewController { } on PlatformException catch (e) { throw CameraException(e.code, e.message); } + } else if (defaultTargetPlatform == TargetPlatform.android) { + final cutOutSize = overlay?.cutOutSize; + if (cutOutSize != null) { + await channel.invokeMethod( + 'changeScanArea', + cutOutSize, + ); + } } return false; } From a9556c9a0ee1a79399a49030807236af266ad907 Mon Sep 17 00:00:00 2001 From: Alexander Tihomirov <56314363+OrangeSofter@users.noreply.github.com> Date: Wed, 28 Jul 2021 12:42:27 +0300 Subject: [PATCH 3/8] Returned BarcodeView back --- .../net/touchcapture/qr/flutterqr/QRView.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index d741286..ac82af1 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -27,7 +27,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: private var isTorchOn: Boolean = false private var isPaused: Boolean = false - private var barcodeView: DecoratedBarcodeView? = null + private var barcodeView: BarcodeView? = null private val channel: MethodChannel = MethodChannel(messenger, "net.touchcapture.qr.flutterqr/qrview_$id") private var permissionGranted: Boolean = false @@ -135,7 +135,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } if (hasFlash()) { - barcodeView!!.barcodeView.setTorch(!isTorchOn) + barcodeView!!.setTorch(!isTorchOn) isTorchOn = !isTorchOn result.success(isTorchOn) } else { @@ -148,7 +148,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: if (barcodeView == null) { return barCodeViewNotSet(result) } else { - if (barcodeView!!.barcodeView.isPreviewActive) { + if (barcodeView!!.isPreviewActive) { isPaused = true barcodeView!!.pause() } @@ -160,7 +160,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: if (barcodeView == null) { return barCodeViewNotSet(result) } else { - if (!barcodeView!!.barcodeView.isPreviewActive) { + if (!barcodeView!!.isPreviewActive) { isPaused = false barcodeView!!.resume() } @@ -193,9 +193,9 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: return initBarCodeView().apply {}!! } - private fun initBarCodeView(): DecoratedBarcodeView? { + private fun initBarCodeView(): BarcodeView? { if (barcodeView == null) { - barcodeView = DecoratedBarcodeView(Shared.activity) + barcodeView = BarcodeView(Shared.activity) if (params["cameraFacing"] as Int == 1) { barcodeView?.cameraSettings?.requestedCameraId = CameraInfo.CAMERA_FACING_FRONT } @@ -236,7 +236,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } private fun stopScan() { - barcodeView?.barcodeView?.stopDecoding() + barcodeView?.stopDecoding() } private fun getSystemFeatures(result: MethodChannel.Result) { @@ -255,7 +255,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: } private fun setScanAreaSize(dpScanAreaWidth: Double, dpScanAreaHeight: Double) { - barcodeView?.barcodeView?.framingRectSize = Size(convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight)) + barcodeView?.framingRectSize = Size(convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight)) } private fun convertDpToPixels(dp: Double) = (dp * barcodeView!!.context.resources.displayMetrics.density).toInt() From 10f969a9d548a38e9be80bb1086d31dfd014293f Mon Sep 17 00:00:00 2001 From: Alexander Tihomirov <56314363+OrangeSofter@users.noreply.github.com> Date: Wed, 28 Jul 2021 15:19:16 +0300 Subject: [PATCH 4/8] Optimized imports --- .../src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index ac82af1..dab94b6 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -13,9 +13,8 @@ import com.google.zxing.ResultPoint import com.journeyapps.barcodescanner.BarcodeCallback import com.journeyapps.barcodescanner.BarcodeResult import com.journeyapps.barcodescanner.BarcodeView -import com.journeyapps.barcodescanner.DecoratedBarcodeView -import io.flutter.plugin.common.BinaryMessenger import com.journeyapps.barcodescanner.Size +import io.flutter.plugin.common.BinaryMessenger import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.PluginRegistry From e4fdc6d9d928d478782cd7905bad58d6490f252e Mon Sep 17 00:00:00 2001 From: Alexander Tihomirov <56314363+OrangeSofter@users.noreply.github.com> Date: Thu, 29 Jul 2021 12:18:08 +0300 Subject: [PATCH 5/8] Used global context to calculate pixels --- .../src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt | 5 +++-- .../kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index dab94b6..eb65444 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -3,6 +3,7 @@ package net.touchcapture.qr.flutterqr import android.Manifest import android.app.Activity import android.app.Application +import android.content.Context import android.content.pm.PackageManager import android.hardware.Camera.CameraInfo import android.os.Build @@ -21,7 +22,7 @@ import io.flutter.plugin.common.PluginRegistry import io.flutter.plugin.platform.PlatformView -class QRView(messenger: BinaryMessenger,private val id: Int, private val params: HashMap) : +class QRView(private val context: Context, messenger: BinaryMessenger, private val id: Int, private val params: HashMap) : PlatformView, MethodChannel.MethodCallHandler, PluginRegistry.RequestPermissionsResultListener { private var isTorchOn: Boolean = false @@ -257,7 +258,7 @@ class QRView(messenger: BinaryMessenger,private val id: Int, private val params: barcodeView?.framingRectSize = Size(convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight)) } - private fun convertDpToPixels(dp: Double) = (dp * barcodeView!!.context.resources.displayMetrics.density).toInt() + private fun convertDpToPixels(dp: Double) = (dp * context.resources.displayMetrics.density).toInt() private fun hasCameraPermission(): Boolean { return permissionGranted || diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt index e16df1d..fcc3f58 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt @@ -12,7 +12,7 @@ class QRViewFactory(private val messenger: BinaryMessenger) : override fun create(context: Context, id: Int, args: Any?): PlatformView { val params = args as HashMap - return QRView(messenger, id, params) + return QRView(context, messenger, id, params) } } \ No newline at end of file From b8911a7fc182f4b47e58bcbc5d6b7ff3fef6a9e7 Mon Sep 17 00:00:00 2001 From: Tihomirov Date: Fri, 30 Jul 2021 12:35:44 +0300 Subject: [PATCH 6/8] Created CustomFramingRectBarcodeView to support changing cutOutBottomOffset --- .../CustomFramingRectBarcodeView.java | 50 +++++++++++++++++++ .../net/touchcapture/qr/flutterqr/QRView.kt | 11 ++-- example/lib/main.dart | 12 +++-- 3 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.java diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.java b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.java new file mode 100644 index 0000000..5203968 --- /dev/null +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/CustomFramingRectBarcodeView.java @@ -0,0 +1,50 @@ +package net.touchcapture.qr.flutterqr; + +import android.content.Context; +import android.graphics.Rect; +import android.util.AttributeSet; + +import com.journeyapps.barcodescanner.BarcodeView; +import com.journeyapps.barcodescanner.Size; + +public class CustomFramingRectBarcodeView extends BarcodeView { + + private static final int BOTTOM_OFFSET_NOT_SET_VALUE = -1; + + private int bottomOffset = BOTTOM_OFFSET_NOT_SET_VALUE; + + public CustomFramingRectBarcodeView(Context context) { + super(context); + } + + public CustomFramingRectBarcodeView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public CustomFramingRectBarcodeView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + protected Rect calculateFramingRect(Rect container, Rect surface) { + Rect containerArea = new Rect(container); + boolean intersects = containerArea.intersect(surface);//adjusts the containerArea (code from super.calculateFramingRect) + Rect scanAreaRect = super.calculateFramingRect(container, surface); + if (bottomOffset != BOTTOM_OFFSET_NOT_SET_VALUE) {//if the setFramingRect function was called, then we shift the scan area by Y + Rect scanAreaRectWithOffset = new Rect(scanAreaRect); + scanAreaRectWithOffset.bottom -= bottomOffset; + scanAreaRectWithOffset.top -= bottomOffset; + + boolean belongsToContainer = scanAreaRectWithOffset.intersect(containerArea); + if(belongsToContainer){ + return scanAreaRectWithOffset; + } + } + return scanAreaRect; + } + + public void setFramingRect(int rectWidth, int rectHeight, int bottomOffset) { + this.bottomOffset = bottomOffset; + this.setFramingRectSize(new Size(rectWidth, rectHeight)); + } +} diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index eb65444..68b41ad 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -13,8 +13,6 @@ import com.google.zxing.BarcodeFormat import com.google.zxing.ResultPoint import com.journeyapps.barcodescanner.BarcodeCallback import com.journeyapps.barcodescanner.BarcodeResult -import com.journeyapps.barcodescanner.BarcodeView -import com.journeyapps.barcodescanner.Size import io.flutter.plugin.common.BinaryMessenger import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel @@ -27,7 +25,7 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v private var isTorchOn: Boolean = false private var isPaused: Boolean = false - private var barcodeView: BarcodeView? = null + private var barcodeView: CustomFramingRectBarcodeView? = null private val channel: MethodChannel = MethodChannel(messenger, "net.touchcapture.qr.flutterqr/qrview_$id") private var permissionGranted: Boolean = false @@ -193,9 +191,10 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v return initBarCodeView().apply {}!! } - private fun initBarCodeView(): BarcodeView? { + private fun initBarCodeView(): CustomFramingRectBarcodeView? { if (barcodeView == null) { - barcodeView = BarcodeView(Shared.activity) + barcodeView = + CustomFramingRectBarcodeView(Shared.activity) if (params["cameraFacing"] as Int == 1) { barcodeView?.cameraSettings?.requestedCameraId = CameraInfo.CAMERA_FACING_FRONT } @@ -255,7 +254,7 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v } private fun setScanAreaSize(dpScanAreaWidth: Double, dpScanAreaHeight: Double) { - barcodeView?.framingRectSize = Size(convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight)) + barcodeView?.setFramingRect (convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight), convertDpToPixels(150.0)) } private fun convertDpToPixels(dp: Double) = (dp * context.resources.displayMetrics.density).toInt() diff --git a/example/lib/main.dart b/example/lib/main.dart index abf6ed0..5010e43 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -151,11 +151,13 @@ class _QRViewExampleState extends State { key: qrKey, onQRViewCreated: _onQRViewCreated, overlay: QrScannerOverlayShape( - borderColor: Colors.red, - borderRadius: 10, - borderLength: 30, - borderWidth: 10, - cutOutSize: scanArea), + borderColor: Colors.red, + borderRadius: 10, + borderLength: 30, + borderWidth: 10, + cutOutSize: /*scanArea*/100, + cutOutBottomOffset: 150, + ), onPermissionSet: (ctrl, p) => _onPermissionSet(context, ctrl, p), ); } From e9570b7919467d732d4eab8e8122e5ac85b5b666 Mon Sep 17 00:00:00 2001 From: Tihomirov Date: Fri, 30 Jul 2021 13:02:11 +0300 Subject: [PATCH 7/8] CutOutBottomOffset taken from the overlay parameter of QRView --- .../net/touchcapture/qr/flutterqr/QRView.kt | 29 +++++++++++++++---- lib/src/qr_code_scanner.dart | 13 +++++---- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt index 68b41ad..8750158 100644 --- a/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt +++ b/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt @@ -88,7 +88,11 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v "getCameraInfo" -> getCameraInfo(result) "getFlashInfo" -> getFlashInfo(result) "getSystemFeatures" -> getSystemFeatures(result) - "changeScanArea" -> changeScanArea(call.arguments as Double, result) + "changeScanArea" -> changeScanArea( + call.argument("cutOutSize")!!, + call.argument("cutOutBottomOffset")!!, + result, + ) else -> result.notImplemented() } } @@ -248,16 +252,29 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v } } - private fun changeScanArea(newSize: Double, result: MethodChannel.Result) { - setScanAreaSize(newSize, newSize) + private fun changeScanArea( + cutOutSize: Double, + cutOutBottomOffset: Double, + result: MethodChannel.Result + ) { + setScanAreaSize(cutOutSize, cutOutSize, cutOutBottomOffset) result.success(true) } - private fun setScanAreaSize(dpScanAreaWidth: Double, dpScanAreaHeight: Double) { - barcodeView?.setFramingRect (convertDpToPixels(dpScanAreaWidth), convertDpToPixels(dpScanAreaHeight), convertDpToPixels(150.0)) + private fun setScanAreaSize( + dpScanAreaWidth: Double, + dpScanAreaHeight: Double, + dpCutOutBottomOffset: Double + ) { + barcodeView?.setFramingRect( + convertDpToPixels(dpScanAreaWidth), + convertDpToPixels(dpScanAreaHeight), + convertDpToPixels(dpCutOutBottomOffset), + ) } - private fun convertDpToPixels(dp: Double) = (dp * context.resources.displayMetrics.density).toInt() + private fun convertDpToPixels(dp: Double) = + (dp * context.resources.displayMetrics.density).toInt() private fun hasCameraPermission(): Boolean { return permissionGranted || diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index fb8f799..d7f9e5c 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -342,13 +342,14 @@ class QRViewController { throw CameraException(e.code, e.message); } } else if (defaultTargetPlatform == TargetPlatform.android) { - final cutOutSize = overlay?.cutOutSize; - if (cutOutSize != null) { - await channel.invokeMethod( - 'changeScanArea', - cutOutSize, - ); + if (overlay == null) { + return false; } + await channel.invokeMethod('changeScanArea', { + 'cutOutSize': overlay.cutOutSize, + 'cutOutBottomOffset': overlay.cutOutBottomOffset + }); + return true; } return false; } From 953a6335248058cffbf3aa77c51f62d5dcb775f4 Mon Sep 17 00:00:00 2001 From: Tihomirov Date: Fri, 30 Jul 2021 13:06:52 +0300 Subject: [PATCH 8/8] Returned standard parameters to example --- example/lib/main.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 5010e43..abf6ed0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -151,13 +151,11 @@ class _QRViewExampleState extends State { key: qrKey, onQRViewCreated: _onQRViewCreated, overlay: QrScannerOverlayShape( - borderColor: Colors.red, - borderRadius: 10, - borderLength: 30, - borderWidth: 10, - cutOutSize: /*scanArea*/100, - cutOutBottomOffset: 150, - ), + borderColor: Colors.red, + borderRadius: 10, + borderLength: 30, + borderWidth: 10, + cutOutSize: scanArea), onPermissionSet: (ctrl, p) => _onPermissionSet(context, ctrl, p), ); }