detectBarcodesFromImages static method
Future<MultiImageBarcodeScanningResult>
detectBarcodesFromImages(
- MethodChannel channel,
- List<
Uri> imageFileUris, { - List<
BarcodeFormat> barcodeFormats = const <BarcodeFormat>[], - BarcodeAdditionalParameters? additionalParameters,
- List<
BarcodeDocumentFormat> acceptedDocumentFormats = const <BarcodeDocumentFormat>[],
Detect barcodes from the given images list
Implementation
static Future<MultiImageBarcodeScanningResult> detectBarcodesFromImages(
MethodChannel channel, List<Uri> imageFileUris,
{List<BarcodeFormat> barcodeFormats = const <BarcodeFormat>[],
BarcodeAdditionalParameters? additionalParameters,
List<BarcodeDocumentFormat> acceptedDocumentFormats =
const <BarcodeDocumentFormat>[]}) async {
try {
var detectFromMultipleImageParams = DetectBarcodeFromImageParams(
barcodeFormats: barcodeFormats,
acceptedDocumentFormats: acceptedDocumentFormats,
additionalParameters: additionalParameters,
uris: imageFileUris);
var barcodeScanningResult = await channel.invokeMethod(
'detectBarcodesOnImages', detectFromMultipleImageParams.toJson());
var result = MultiImageBarcodeScanningResult.fromJson(
jsonDecode(barcodeScanningResult));
return result;
} catch (e) {
Logger.root.severe(e);
return MultiImageBarcodeScanningResult.error("parsing exception");
}
}