remove multiple foundcode calls
This commit is contained in:
parent
05aabec4ad
commit
887881bb84
1 changed files with 6 additions and 1 deletions
|
|
@ -23,10 +23,15 @@ class _MihBarcodeScannerState extends State<MihBarcodeScanner>
|
|||
);
|
||||
StreamSubscription<Object>? _subscription;
|
||||
bool _isScannerStarting = false;
|
||||
bool barcodeScanned = false;
|
||||
|
||||
void foundCode(BarcodeCapture bcode) {
|
||||
if (bcode.barcodes.isNotEmpty && bcode.barcodes.first.rawValue != null) {
|
||||
if (mounted &&
|
||||
barcodeScanned == false &&
|
||||
bcode.barcodes.isNotEmpty &&
|
||||
bcode.barcodes.first.rawValue != null) {
|
||||
setState(() {
|
||||
barcodeScanned = true;
|
||||
widget.cardNumberController.text = bcode.barcodes.first.rawValue!;
|
||||
});
|
||||
print(bcode.barcodes.first.rawValue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue