feat: rawValue toLowerCase

This commit is contained in:
Charon-Fan 2024-12-06 09:27:06 +08:00
parent 9fcbc4d72a
commit 10b088021c

View file

@ -68,11 +68,12 @@ class _BarcodeScannerSimpleState extends State<BarcodeScannerSimple> {
void _handleBarcodeInternal(BarcodeCapture barcodes) { void _handleBarcodeInternal(BarcodeCapture barcodes) {
for (final barcode in barcodes.barcodes) { for (final barcode in barcodes.barcodes) {
// don't handle unknown QR codes // don't handle unknown QR codes
if (barcode.rawValue?.trim().isEmpty??false == false) continue; var rawValue = barcode.rawValue?.toLowerCase();
if (barcode.rawValue!.startsWith("ur:")) { if (rawValue?.trim().isEmpty??false == false) continue;
if (urCodes.contains(barcode.rawValue)) continue; if (rawValue!.startsWith("ur:")) {
if (urCodes.contains(rawValue)) continue;
setState(() { setState(() {
urCodes.add(barcode.rawValue!); urCodes.add(rawValue!);
ur = URQRToURQRData(urCodes); ur = URQRToURQRData(urCodes);
}); });
if (ur.progress == 1) { if (ur.progress == 1) {