juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
880 stars 510 forks source link

CameraController doesn't switch cameras when we call switchCamera #788

Open pneves001 opened 1 year ago

pneves001 commented 1 year ago

I'm using an Ulefone armor X 10. With Android 11. The camera controller seems flakey. It doesn't switch cameras when we call switchCamera and sometimes the torch doesn't work.

I have to close out of the screen and reopen it to get the camera to start working again. And I am disposing of the CameraController in the dispose function to do it and then opening it up again.

Ive tried stopping the scan before calling the switch camera function and restarting it to no avail.

Whatever camera is set when we setup the mobile_scanner control is what gets used and it works otherwise. But just doesn't want to switch cameras.

ZiadElgaraihe commented 12 months ago

I get the same problem and i don't know how to solve it

Dr-Usman commented 11 months ago

Facing same issue. Camera controller dispose method called by itself when pop from scanner page. That's why couldn't able to switch camera and toggle flash light.