pdliuw / ai_barcode

Barcode generation,Barcode scanning,qrcode,qrcode generation,qrcode creator,flutter barcode,flutter qrcode,support android iOS web platform
BSD 3-Clause "New" or "Revised" License
125 stars 82 forks source link

flutter web qr code scan issue - qr code not detected #66

Closed KevinRohn closed 2 years ago

KevinRohn commented 2 years ago

Hi community,

first of all. Thank you for this awesome package. I upgraded all the packages to the latest version. Now I'm facing the issue, that the qr code scan for flutter web is not working anymore. I know about the issue with the qr_flutter: ^4.0.0.0 Version.

If you try to build the example project, there will be following error:

../../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ai_barcode_web-3.0.1/lib/ai_barcode_web.dart:119:5: Error:
'QrImageView' isn't a type.
    QrImageView qrImage = QrImageView(
    ^^^^^^^^^^^
../../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ai_barcode_web-3.0.1/lib/ai_barcode_web.dart:119:27: Error: The
method 'QrImageView' isn't defined for the class 'AiBarcodeCreatorWebPlugin'.
 - 'AiBarcodeCreatorWebPlugin' is from 'package:ai_barcode_web/ai_barcode_web.dart'
 ('../../../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ai_barcode_web-3.0.1/lib/ai_barcode_web.dart').
Try correcting the name to the name of an existing method, or defining a method named 'QrImageView'.
    QrImageView qrImage = QrImageView(

So I added an dependency_overrides entry in the pubspec.yaml file.

dependency_overrides:
  qr_flutter:
    git:
      url: https://github.com/lukef/qr.flutter.git
      ref: master

The issue comes because of a breaking code change from the qr: ^3.0.1 library. The master branch of the qr_flutter package already has the changes implemented and the code builds without any errors.

But for flutter web I still can't scan any qr codes. Do you have any hints for me to get this to work again?

Thank you in advance, cheers Kevin

KevinRohn commented 2 years ago

I tested it! - It works, thank you so much.