Closed jazz-mobility closed 9 months ago
@RafaelBarbosatec can you please take a look and get this merged if it looks good?
Hi @jazz-mobility ! Thanks for reporting this issue. So, but if someone not want stop stream when captured the first one?
Hey @RafaelBarbosatec Sure, there can be such use cases. We can add a property to configure scanning type. I'll update the PR next week. if you have time earlier, feel free to update it. Thanks :)
I see you fixed it. Nice one. ❤️
First of all thanks for this amazing library. It is very easy to use. :)
I am using the live mode to auto-detect the QR codes and then dismiss the view presented as the bottom modal sheet.
I figured that the library kept calling the onCapture with Results even after it detected the QR code, what is the reason for this? You can verify it from the logs below.
As I get multiple callbacks in the onCapture, my Navigation stack gets messed up due to the multiple
.pop() calls
, which is undesirable.After a quick look into the code, I propose to stop the Image stream after calling onCapture. It will return the scanned value and also will optimize the library performance. Adding
await controller?.stopImageStream();
after this line works for me, let me know what you think. https://github.com/RafaelBarbosatec/qr_code_dart_scan/blob/45979ab8ded25f5c24ab6258789271efde84a546/lib/src/qr_code_dart_scan_view.dart#L142