Closed PlemonsBrett closed 2 years ago
You can use the following parameter to control which camera to use: cameraFacing: CameraFacing.front
return QRView(
key: qrKey,
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.front,
onQRViewCreated: _onQRViewCreated,
overlay: QrScannerOverlayShape(
borderColor: Colors.blueGrey,
borderRadius: 10,
borderLength: 30,
borderWidth: 10,
cutOutSize: scanArea),
);
Is your feature request related to a problem? Please describe. I am using the qr_code_scanner as a price scanner for our mobile app and our in store kiosk stations. I am currently using the
_onQRViewCreated
method to check the in use camera withcontroller.getCameraInfo()
and usingto flip the camera if it is
CameraFacing.back
. The problem with this method is that sometimes it will "try" to switch the camera and instead of actually switching the camera it just goes to a blank camera view (i.e. not using either camera).Describe the solution you'd like What I would like to be able to do is either in the Main method, or in the build of the widget that handles the controller to be able to do something like
controller.DefaultCamera(CameraFacing.front);
or something that will cause the same effect so that it always just defaults to that camera.Additional context Here is my complete code for that widget
If this is a feature that already exists that would be awesome, I just couldn't find it in the API docs. But this is something that I really need as for our Kiosk stations we do not want the person using the kiosk to have the ability to change the camera. We at some point, would also like to be able to use an external QR/Barcode reader but dont know if that is something supported here or if we would have to, at that time, look into a different library to implement this.