Flutter: Most common pitfalls

A curated list of frequently encountered issues when integrating the barKoder Flutter SDK—and their proven solutions.

Keep this page updated as new support cases emerge.

1. Do you have a sample code snippet for continuous scanning? #

Solution: In the case of running a continuous scan, you can follow these steps:

                    _barkoder.setCloseSessionOnResultEnabled(false);
            

You can also look at our examples on this link - https://barkoder.com/docs/v1/flutter/flutter-example/enable-continuous-scanning

2. Can you provide a short explanation of what result.textualData contains and how it should be used? #

Solution: In order to demonstrate how to use the startScanning method, here is an example:

                    _barkoder!.startScanning((result) {
          setState(() {
            scannedResult = result.decoderResults[0].textualData;
            isScanning = false;
          });
        });
            

Using this method, you can get the results for the MRZ or barcode - textualData is formatted, while extraData is a bit more detailed:

                    result.decoderResults[0].textualData
            
                    result.decoderResults[0].extra?.toString() ?? '' // if you like to print as String
            

It is up to you as to how you use or manipulate/extract fields from the string in the way that works best for you

3. How to enable MRZ Mode for Flutter? #

Solution: To enable MRZ functionality, check out the following code:

                _barkoder.setBarcodeTypeEnabled(BarcodeType.idDocument, true);
            

Page Contents