wu9007 / qrcode_scanner

🛠 Flutter QR code scanner plugin.
MIT License
358 stars 185 forks source link

Always throws the error when the analyze fails #92

Closed lucaslannes closed 3 years ago

lucaslannes commented 3 years ago

Error com.google.zxing.NotFoundException

Platform Android

Flutter 1.22.5

Dart 2.10.4

The method scanBytes works fine with images that have some QR Code to analyze, but if you scan something without any QR Code the plugin doesn't returns the error. Using Visual Studio Code, I can see on Debug Console the message W/System.err(27635): com.google.zxing.NotFoundException. Unfortunatelly, the error can't be catched inside a try/catch block or catchError of the Future.

The current solution is return all errors catched by onAnalyzeFailed even if errorCode was equals to null, because the method onAnalyzeFailed is called when any error occurs.