startVINScanner static method
Starts the VIN (Vehicle Identification Number) Scanner UI with the provided config
.
Returns a ResultWrapper containing a VinScannerUiResult on success, or an error if the operation fails.
Implementation
static Future<ResultWrapper<VinScannerUiResult>> startVINScanner(
VinScannerScreenConfiguration config) async {
try {
var result = await ScanbotSdk.channel
.invokeMethod('startVINScannerV2', config.toJson());
return ResultWrapper.fromJson(jsonDecode(result),
fromJsonT: (data) =>
VinScannerUiResult.fromJson(data as Map<String, dynamic>));
} on PlatformException catch (e) {
Logger.root.severe(e);
return ResultWrapper.error(e.message ?? 'Unknown platform error');
} on Exception catch (e) {
return ResultWrapper.error(e.toString());
}
}