mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

MobileScanner does not detect qr when toggled back on same screen, but works after navigating from previous screen

Open hrshere opened this issue 2 years ago • 5 comments

Actually, I'm using a scan button to show scanner and hide content and vice versa. I have placed my scanner inside a scaffold and a back button is defined which just sets back the boolean used for above mentioned purpose to false, thus showing my content and hiding scanner. When i click on the scan button again, it does shows the scanner again, but no qr could be detected.

I'm using Getx for state Management.

Please help me find if this is a package specific issue ! If yes, how could i fix this. (In example, BarcodeScannerWithOverlay, it uses similar pattern but upon pressing back button in scanner page , it navigates back to previous page, rather than being on same page as in my case)

hrshere avatar Jan 09 '24 08:01 hrshere

Same thing, I'm trying to figure out how it works under the hood!

EhabSalah avatar Jan 09 '24 10:01 EhabSalah

same issue here. When the screen is rotated and it rebuilds, it no longer triggers detect.

hioshih avatar Jan 11 '24 21:01 hioshih

@EhabSalah @hrshere @hioshih Hello everyone, I found a solution for this as follows: Dispose of the controller when the scanning is finished or when you close it. Reassign the controller just before running it again.

muhammetemircakir avatar Jan 11 '24 23:01 muhammetemircakir

Hi @muhammetemircakir , can you share some code snippet for the same? Thank you

hrshere avatar Jan 12 '24 04:01 hrshere

hi any update for this?

Sofrosine avatar Feb 23 '24 10:02 Sofrosine