BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!
Describe the bug
Whatever I set as useCamera - option is ignored.
I found four cameras on my device with numberOfCameras, used options 0 to 3 and 1 to 4 - no changes. Only the back camera is used. Even if I set the option to 20 or something entirely outside the range - doesn't matter.
To Reproduce
This is my code:
Future barcodeScanning() async {
try {
var _numberOfCameras = await BarcodeScanner.numberOfCameras;
var options = ScanOptions(
useCamera: 1
);
var barcodeRes = await BarcodeScanner.scan(options: options);
barcode = barcodeRes.rawContent;
Flutter ...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [Version 10.0.19041.329], locale de-AT)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 4.0)
[√] VS Code, 32-bit edition (version 1.45.1)
[√] Connected device (1 available)
• No issues found!
**Additional context**
Add any other context about the problem here.
Thanks for your help!
Markus
BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!
Describe the bug Whatever I set as useCamera - option is ignored. I found four cameras on my device with numberOfCameras, used options 0 to 3 and 1 to 4 - no changes. Only the back camera is used. Even if I set the option to 20 or something entirely outside the range - doesn't matter.
To Reproduce This is my code: Future barcodeScanning() async { try { var _numberOfCameras = await BarcodeScanner.numberOfCameras; var options = ScanOptions( useCamera: 1 ); var barcodeRes = await BarcodeScanner.scan(options: options); barcode = barcodeRes.rawContent;
Expected behavior I want to switch between cameras with option useCamera as described.
Found out, that index 1 should be front camera (https://stackoverflow.com/questions/55770802/flutter-how-to-scan-qr-code-with-front-camera). But first useCamera must work in general.
Screenshots If applicable, add screenshots to help explain your problem.
Logs If applicable, add the verbose output of
flutter run
.Environment (please complete the following information):
barcode_scan
3.0.1flutter --version
: Flutter 1.17.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 1ad9baa8b9 (2 weeks ago) • 2020-06-17 14:41:16 -0700 Engine • revision ee76268252 Tools • Dart 2.8.4[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 4.0) [√] VS Code, 32-bit edition (version 1.45.1) [√] Connected device (1 available)
• No issues found!