From 058cde1d3d2648a08b4f71a1e0cda948e8f9462e Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 28 Jul 2021 22:36:39 +1000 Subject: [PATCH] Adjust calls in barcode.dart to match example --- lib/barcode.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/barcode.dart b/lib/barcode.dart index af7d5592..e96efe53 100644 --- a/lib/barcode.dart +++ b/lib/barcode.dart @@ -489,6 +489,8 @@ class InvenTreeQRView extends StatefulWidget { class _QRViewState extends State { + final GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); + QRViewController? _controller; final BarcodeHandler _handler; @@ -500,17 +502,16 @@ class _QRViewState extends State { @override void reassemble() { super.reassemble(); + if (Platform.isAndroid) { - _controller?.pauseCamera(); - } else if (Platform.isIOS) { - _controller?.resumeCamera(); + _controller!.pauseCamera(); } + + _controller!.resumeCamera(); } _QRViewState(this._handler) : super(); - final GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); - void _onViewCreated(QRViewController controller) { _controller = controller; controller.scannedDataStream.listen((barcode) {