Skip to content

Commit 508c134

Browse files
update example to 2.0.0 (#29)
1 parent dc59984 commit 508c134

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ class _ScanPageState extends State<ScanPage> {
9797
},
9898
detector: FirebaseVision.instance.barcodeDetector().detectInImage,
9999
onResult: (List<Barcode> barcodes) {
100-
if (!mounted || resultSent) {
100+
if (!mounted ||
101+
resultSent ||
102+
barcodes == null ||
103+
barcodes.isEmpty) {
101104
return;
102105
}
103106
resultSent = true;

example/lib/main_live.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class _MyHomePageState extends State<MyHomePage> {
4343
key: _scanKey,
4444
detector: FirebaseVision.instance.barcodeDetector().detectInImage,
4545
onResult: (barcodes) {
46-
if (data.contains(barcodes.first.displayValue) || !mounted) {
46+
if (barcodes == null ||
47+
barcodes.isEmpty ||
48+
data.contains(barcodes.first.displayValue) ||
49+
!mounted) {
4750
return;
4851
}
4952
setState(() {

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ packages:
7070
path: ".."
7171
relative: true
7272
source: path
73-
version: "1.5.1"
73+
version: "2.0.0"
7474
flutter_test:
7575
dependency: "direct dev"
7676
description: flutter

0 commit comments

Comments
 (0)