startLicensePlateScanner static method

Future<LicensePlateScanResult> startLicensePlateScanner(
  1. LicensePlateScannerConfiguration config
)

Starts the Ready-to-Use License Plate Scanner UI as full-screen modal UI dialog. The License Plate Scanner is able to recognize european car license plates.

Implementation

static Future<LicensePlateScanResult> startLicensePlateScanner(
    LicensePlateScannerConfiguration config) async {
  try {
    var updatedParameters = config.toJson();
    const defaultJsonName = "LicensePlateScreen";
    var configuration = await SharedCalls.applyParametersOnDefaultJson(
        defaultJsonName, updatedParameters);
    var result = await SharedCalls.invoke(
        _channel, 'startLicensePlateScanner', configuration);
    if (SharedCalls.wasCanceled(result)) {
      return LicensePlateScanResult.canceled();
    }
    return LicensePlateScanResult.fromJson(jsonDecode(result));
  } catch (e) {
    Logger.root.severe(e);
    return LicensePlateScanResult.error(e.toString());
  }
}