onBarcodeResult method

Future<void> onBarcodeResult(
  1. String _barcode
)

Method called on barcode result to finish the process and send result

Implementation

Future<void> onBarcodeResult(String _barcode) async {
  _barcodeResults.add(_barcode);
  if (_barcodeResults.gotResult) {
    releaseResources();
    if (!completer.isCompleted) {
      completer.complete(_barcodeResults.mostFrequentBarcode);
      _barcodeResults.clear();
    }
  }
}