How to scan QR code with Flutter web app?

Viewed 12

I've search and tried these plugins:

qr_bar_code_scanner_dialog: ^0.0.5

ai_barcode_scanner: ^0.0.1+1

But none of these works when I tried to open my Web app in my phones browser. The screen turns black when I press my Button that should have started the scanner.

I've seen that many others have problems with this. So I hope there is a solution out there that works for me. The whole reason I use Flutter is that it seems to be the easiest way to develope an app for both Android and iOS, using Web.

In debug mode everything works fine with desktop browser and phone. But not when I have deployed my app with Firebase Hosting and use the phone browser.

IconButton(
              onPressed: (){
                //scanQR();
                _qrBarCodeScannerDialogPlugin.getScannedQrBarCode(
                    context: context,
                    onCode: (code) {
                      print(code);
                      setState(() {
                        this.code = code;
                      });
                    });
              },
              icon: const Icon(Icons.qr_code_scanner),
              iconSize: 130,
              tooltip: 'Scan',
              color: const Color.fromRGBO(28,37,44,1),
            ),
0 Answers
Related