Closed navarrete0 closed 1 year ago
Code:
BarcodeKeyboardListener( bufferDuration: const Duration(milliseconds: 200), onBarcodeScanned: (barcode) { if (kDebugMode) {print(barcode);} if(barcode.isNotEmpty) { searchBarcode(barcode); } else{ //restart listener?? Get.snackbar( "Not found", "Please restart app", icon: const Icon(Icons.error, color: Colors.black), snackPosition: SnackPosition.BOTTOM, duration: const Duration(seconds: 2) ); } }, child: const SizedBox( width: double.infinity, height: 1),),
How can I restart the listener into the app if i get empty?
There is no need to restart anything. BarcodeKeyboardListener will be listening if it's in the widget tree.
Code:
How can I restart the listener into the app if i get empty?