startEhicScanner static method
Starts the Ready-to-Use EHIC Scanner UI as full-screen modal UI dialog. The EHIC Scanner is able to recognize and parse data from the backside of European Health Insurance Cards.
Implementation
static Future<HealthInsuranceCardRecognitionResult> startEhicScanner(
HealthInsuranceScannerConfiguration config) async {
try {
var updatedParameters = config.toJson();
const defaultJsonName = "EhicScreen";
var configuration = await SharedCalls.applyParametersOnDefaultJson(
defaultJsonName, updatedParameters);
var result =
await SharedCalls.invoke(_channel, 'startEhicScanner', configuration);
if (SharedCalls.wasCanceled(result)) {
return HealthInsuranceCardRecognitionResult.canceled();
}
return HealthInsuranceCardRecognitionResult.fromJson(jsonDecode(result));
} catch (e) {
Logger.root.severe(e);
return HealthInsuranceCardRecognitionResult(
<HealthInsuranceCardField>[], null);
}
}