zxingReadBarcodeImageUrl function

Future<Code> zxingReadBarcodeImageUrl(
  1. String url,
  2. DecodeParams params
)

Reads barcode from image url

Returns a Code carrying an error instead of throwing when the image cannot be fetched or decoded.

Implementation

Future<Code> zxingReadBarcodeImageUrl(String url, DecodeParams params) async {
  final _DecodedImage decoded = await _decodeImageUrl(url, params);
  if (decoded.error != null) {
    return Code(error: decoded.error, source: CodeSource.remoteImageFile);
  }
  return _readBarcode(
    decoded.bytes!,
    decoded.params!,
    CodeSource.remoteImageFile,
  );
}