Is your feature request related to a problem? Please describe.
There's a bug in zxing, preventing QR-code scans to be performed in android API 23 and lower (app crash).
I've opened an PR about it, but I'm not sure it will be accepted eventually.
In my specific use-case, I don't care about QR codes, I just care about barcodes.
But it looks like in qr_code_scanner, all barcode formats are tried, and then the not desired barcode formats are filtered out.
It means that even if I say "just scan EAN13", the problematic QR-code scan will be run (and crash).
Beyond the fact that my app crashes (which bothers me, I admit), it means that the scan could be optimized by checking only the desired barcode formats and not all formats.
Describe the solution you'd like
I'm not familiar with kotlin but what I managed to write as a test is something like that (in QRView.kt):
private fun initBarCodeView(): CustomFramingRectBarcodeView {
var barcodeView = barcodeView
if (barcodeView == null) {
barcodeView = CustomFramingRectBarcodeView(QrShared.activity).also {
this.barcodeView = it
}
// this is where I add my list of formats
barcodeView.decoderFactory = DefaultDecoderFactory(mutableListOf(BarcodeFormat.EAN_8, BarcodeFormat.EAN_13), null, null, 2)
//...
Of course this barcode list should match widget.formatsAllowed in qr_code_scanner.dart, but as I've said I don't code in kotlin. But I'm sure it can be done ;)
Hi @BraveEvidence!
Could you be a little more specific?
In the current issue I say I would like to use qr_code_scanner with only specified barcode formats. Where in the videos is that topic evoked?
Is your feature request related to a problem? Please describe. There's a bug in zxing, preventing QR-code scans to be performed in android API 23 and lower (app crash). I've opened an PR about it, but I'm not sure it will be accepted eventually.
In my specific use-case, I don't care about QR codes, I just care about barcodes. But it looks like in qr_code_scanner, all barcode formats are tried, and then the not desired barcode formats are filtered out. It means that even if I say "just scan EAN13", the problematic QR-code scan will be run (and crash).
Beyond the fact that my app crashes (which bothers me, I admit), it means that the scan could be optimized by checking only the desired barcode formats and not all formats.
Describe the solution you'd like I'm not familiar with kotlin but what I managed to write as a test is something like that (in
QRView.kt
):Of course this barcode list should match
widget.formatsAllowed
inqr_code_scanner.dart
, but as I've said I don't code in kotlin. But I'm sure it can be done ;)