analyzeImage method
Scans local image file at imagePath (mobile_scanner.analyzeImage compatibility).
Implementation
Future<BarcodeCapture?> analyzeImage(String imagePath) async {
final result = await _controller.analyzeImage(imagePath);
if (!result.isValid) return null;
final list = result.detectedBarcodes ??
[
BarcodeResult(
format: result.format ?? 'BARCODE',
rawValue: result.rawValue,
displayValue: result.rawValue,
)
];
return BarcodeCapture(
barcodes: list,
rawResult: result,
imageSize: result.imageSize,
);
}