Skip to content

Commit

Permalink
- camera only feed mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafa96m committed Sep 3, 2020
1 parent 866292c commit b8e042b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/universal_barcode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class UniversalBarcode extends StatefulWidget {
final Function(String code) didCatchCode;
final List<BarcodeFormat> lookupFormats;
final bool autoselectBarcodeScanner;
final bool onlyCameraFeed;
UniversalBarcode(this.didCatchCode, this.lookupFormats,
{this.autoselectBarcodeScanner = false});
{this.autoselectBarcodeScanner = false, this.onlyCameraFeed = false});

@override
State<StatefulWidget> createState() => _UniversalBarcodeState();
Expand Down Expand Up @@ -90,6 +91,11 @@ class _UniversalBarcodeState extends State<UniversalBarcode> {

@override
Widget build(BuildContext context) {
if (widget.onlyCameraFeed) return buildCameraFeed();
return _buildSelectionLayout();
}

Container _buildSelectionLayout() {
return Container(
width: double.infinity,
child: Column(
Expand Down Expand Up @@ -220,7 +226,7 @@ class _UniversalBarcodeState extends State<UniversalBarcode> {

Widget buildCameraFeed() {
return Container(
height: 210,
height: widget.onlyCameraFeed ? double.infinity : 210,
child: LastQrScannerPreview(
key: qrKey,
lookupFormats: widget.lookupFormats,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:

Expand Down

0 comments on commit b8e042b

Please sign in to comment.