startVinScanner static method

Future<VinScanResult> startVinScanner(
  1. VinScannerConfiguration config
)

Starts the VIN Scanner UI as full-screen modal UI dialog. Allow to capture vehicle identification numbers (VINs)

Implementation

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