From 45b940744b1635b1764d1dc052ae46ef4d0ce371 Mon Sep 17 00:00:00 2001 From: Tihomirov Date: Tue, 5 Oct 2021 15:39:20 +0300 Subject: [PATCH] Formatting code --- lib/src/qr_code_scanner.dart | 2 +- lib/src/qr_scanner_overlay_shape.dart | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index 88b0d42..a194395 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -334,7 +334,7 @@ class QRViewController { await channel.invokeMethod('setDimensions', { 'width': renderBox.size.width, 'height': renderBox.size.height, - 'scanArea': overlay?.cutOutWidth ?? 0,//Todo + 'scanArea': overlay?.cutOutWidth ?? 0, //Todo 'scanAreaOffset': overlay?.cutOutBottomOffset ?? 0 }); return true; diff --git a/lib/src/qr_scanner_overlay_shape.dart b/lib/src/qr_scanner_overlay_shape.dart index b101652..0d41090 100644 --- a/lib/src/qr_scanner_overlay_shape.dart +++ b/lib/src/qr_scanner_overlay_shape.dart @@ -76,11 +76,14 @@ class QrScannerOverlayShape extends ShapeBorder { final borderWidthSize = width / 2; final height = rect.height; final borderOffset = borderWidth / 2; - final _borderLength = borderLength > min(cutOutHeight, cutOutHeight) / 2 + borderWidth * 2 - ? borderWidthSize / 2 - : borderLength; - final _cutOutWidth = cutOutWidth < width ? cutOutWidth : width - borderOffset; - final _cutOutHeight = cutOutHeight < height ? cutOutHeight : height - borderOffset; + final _borderLength = + borderLength > min(cutOutHeight, cutOutHeight) / 2 + borderWidth * 2 + ? borderWidthSize / 2 + : borderLength; + final _cutOutWidth = + cutOutWidth < width ? cutOutWidth : width - borderOffset; + final _cutOutHeight = + cutOutHeight < height ? cutOutHeight : height - borderOffset; final backgroundPaint = Paint() ..color = overlayColor