File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,10 @@ class _ScanPageState extends State<ScanPage> {
97
97
},
98
98
detector: FirebaseVision .instance.barcodeDetector ().detectInImage,
99
99
onResult: (List <Barcode > barcodes) {
100
- if (! mounted || resultSent) {
100
+ if (! mounted ||
101
+ resultSent ||
102
+ barcodes == null ||
103
+ barcodes.isEmpty) {
101
104
return ;
102
105
}
103
106
resultSent = true ;
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ class _MyHomePageState extends State<MyHomePage> {
43
43
key: _scanKey,
44
44
detector: FirebaseVision .instance.barcodeDetector ().detectInImage,
45
45
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) {
47
50
return ;
48
51
}
49
52
setState (() {
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ packages:
70
70
path: ".."
71
71
relative: true
72
72
source: path
73
- version: "1.5.1 "
73
+ version: "2.0.0 "
74
74
flutter_test:
75
75
dependency: "direct dev"
76
76
description: flutter
You can’t perform that action at this time.
0 commit comments