zxingReadBarcode function

Code zxingReadBarcode(
  1. Uint8List bytes, {
  2. required int width,
  3. required int height,
  4. DecodeParams? params,
})

Implementation

Code zxingReadBarcode(
  Uint8List bytes, {
  required int width,
  required int height,
  DecodeParams? params,
}) {
  Code result = _readBarcode(bytes, width, height, params);
  if (!result.isValid && params != null && params.tryInverted == true) {
    // try to invert the image and read again
    final Uint8List invertedBytes = invertImage(bytes);
    result = _readBarcode(invertedBytes, width, height, params);
  }
  return result;
}