retrieveData method
Future<(DocReaderAction, Results?, DocReaderException?)>
retrieveData(
- DataRetrieval retrieval, {
- MDLDeviceRetrieval? withoutUI,
- DeviceEngagement? engagement,
Used to retrieve data.
withoutUI - If set, then Regula's UI will not be shown and user is supposed to implement the UI himself.
engagement - Required for withoutUI = null or MDLDeviceRetrieval.BLE. Not needed for MDLDeviceRetrieval.NFC.
Implementation
Future<(DocReaderAction action, Results? results, DocReaderException? error)>
retrieveData(
DataRetrieval retrieval, {
MDLDeviceRetrieval? withoutUI,
DeviceEngagement? engagement,
}) async {
var function = "startRetrieveData";
if (withoutUI == MDLDeviceRetrieval.NFC) function = "engageDeviceNFC";
if (withoutUI == MDLDeviceRetrieval.BLE) function = "engageDeviceBLE";
var jsonObject = json.decode(await _bridge.invokeMethod(function, [
retrieval.toJson(),
engagement?.toJson(),
]));
return (
DocReaderAction.getByValue(jsonObject["action"])!,
Results.fromJson(jsonObject["results"]),
DocReaderException.fromJson(jsonObject["error"]),
);
}