analyzeImage method

Future<BarcodeCapture?> analyzeImage(
  1. String path, {
  2. List<BarcodeFormat> formats = const <BarcodeFormat>[],
})

Analyze an image file.

The path points to a file on the device. The formats specify the barcode formats that should be detected in the image. If the formats are omitted or empty, all formats are detected.

This is only supported on Android, iOS and MacOS.

Returns the BarcodeCapture that was found in the image.

If an error occurred during the analysis of the image, a MobileScannerBarcodeException error is thrown.

Implementation

Future<BarcodeCapture?> analyzeImage(
  String path, {
  List<BarcodeFormat> formats = const <BarcodeFormat>[],
}) {
  return MobileScannerPlatform.instance.analyzeImage(path, formats: formats);
}