From 2327953c257f52faab20a94ad1538adf5ded5b2b Mon Sep 17 00:00:00 2001 From: Julian Steenbakker Date: Tue, 22 Dec 2020 09:49:36 +0100 Subject: [PATCH] Release of v0.2.1 --- CHANGELOG.md | 3 +++ lib/src/qr_code_scanner.dart | 9 +++++++-- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc36c3..b913faf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.2.1 +* Fixed critical bug where scanner wouldn't open when no scan overlay was configured. + ## 0.2.0 #### Breaking change * The plugin now returns Barcode object instead of QR String. This object includes the type of code, the code itself and on Android devices the raw bytes. (#63) diff --git a/lib/src/qr_code_scanner.dart b/lib/src/qr_code_scanner.dart index 405c179..7a60428 100644 --- a/lib/src/qr_code_scanner.dart +++ b/lib/src/qr_code_scanner.dart @@ -159,8 +159,13 @@ class _QRViewState extends State { return; } - widget.onQRViewCreated(QRViewController._( - id, widget.key, (widget.overlay as QrScannerOverlayShape).cutOutSize)); + // We pass the cutout size so that the scanner respects the scan area. + var cutOutSize = 0.0; + if (widget.overlay != null) { + cutOutSize = (widget.overlay as QrScannerOverlayShape).cutOutSize; + } + + widget.onQRViewCreated(QRViewController._(id, widget.key, cutOutSize)); } } diff --git a/pubspec.yaml b/pubspec.yaml index bf1a3c0..1fe733a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: qr_code_scanner description: QR code scanner that can be embedded inside flutter. It uses zxing in Android and MTBBarcode scanner in iOS. -version: 0.2.0 +version: 0.2.1 homepage: https://juliuscanute.com repository: https://github.com/juliuscanute/qr_code_scanner