From b8e042be47f0abb7cb75737f2568f34711d9d1c5 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Thu, 3 Sep 2020 17:21:33 +0300 Subject: [PATCH] - camera only feed mode. --- lib/universal_barcode.dart | 10 ++++++++-- pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/universal_barcode.dart b/lib/universal_barcode.dart index 5f47fe5..1b828d1 100644 --- a/lib/universal_barcode.dart +++ b/lib/universal_barcode.dart @@ -14,8 +14,9 @@ class UniversalBarcode extends StatefulWidget { final Function(String code) didCatchCode; final List lookupFormats; final bool autoselectBarcodeScanner; + final bool onlyCameraFeed; UniversalBarcode(this.didCatchCode, this.lookupFormats, - {this.autoselectBarcodeScanner = false}); + {this.autoselectBarcodeScanner = false, this.onlyCameraFeed = false}); @override State createState() => _UniversalBarcodeState(); @@ -90,6 +91,11 @@ class _UniversalBarcodeState extends State { @override Widget build(BuildContext context) { + if (widget.onlyCameraFeed) return buildCameraFeed(); + return _buildSelectionLayout(); + } + + Container _buildSelectionLayout() { return Container( width: double.infinity, child: Column( @@ -220,7 +226,7 @@ class _UniversalBarcodeState extends State { Widget buildCameraFeed() { return Container( - height: 210, + height: widget.onlyCameraFeed ? double.infinity : 210, child: LastQrScannerPreview( key: qrKey, lookupFormats: widget.lookupFormats, diff --git a/pubspec.yaml b/pubspec.yaml index c913317..a6daef2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: universal_barcode description: This module is being used internally to handle scanning barcodes in different modes. -version: 0.0.7 +version: 0.0.8 author: Miswag homepage: