processImage method

Future<List<Barcode>> processImage(
  1. InputImage inputImage
)

Processes the given InputImage for barcode scanning. Returns a list of Barcode.

Implementation

Future<List<Barcode>> processImage(InputImage inputImage) async {
  final result = await _channel.invokeMethod('vision#startBarcodeScanner', {
    'formats': formats.map((f) => f.rawValue).toList(),
    'id': id,
    'imageData': inputImage.toJson()
  });

  final barcodesList = <Barcode>[];
  for (final dynamic json in result) {
    barcodesList.add(Barcode.fromJson(json));
  }

  return barcodesList;
}