detectFromImageFile static method

Future<BarcodeScanningResult> detectFromImageFile(
  1. Uri file,
  2. List<BarcodeFormat> barcodeFormats,
  3. bool enableHighSensitivityMode
)

Detect barcodes from image file uri The Barcode Scanner is able to recognize 1D- and 2D-barcodes (QR codes, etc). image rotation between 0-360 degrees with 90 degree step barcodeFormats Format of barcode which need to recognize

Implementation

static Future<BarcodeScanningResult> detectFromImageFile(
    Uri file,
    List<BarcodeFormat> barcodeFormats,
    bool enableHighSensitivityMode) async {
  try {
    var detectFromImageParams = DetectFromImageParams(
        file, barcodeFormats, enableHighSensitivityMode);
    var barcodeScanningResult = await _channel.invokeMethod(
        'detectFromImageFile', detectFromImageParams.toJson());
    return BarcodeScanningResult.fromJson(jsonDecode(barcodeScanningResult));
  } catch (e) {
    return BarcodeScanningResult.error(e.toString());
  }
}