readMDL method

Used to read MDL.

Implementation

Future<(DocReaderAction action, Results? results, DocReaderException? error)>
    readMDL(MDLDeviceEngagement type, DataRetrieval retrieval) async {
  var response = await _bridge.invokeMethod("startReadMDl", [
    type.value,
    retrieval.toJson(),
  ]);
  var jsonObject = json.decode(response);
  return (
    DocReaderAction.getByValue(jsonObject["action"])!,
    Results.fromJson(jsonObject["results"]),
    DocReaderException.fromJson(jsonObject["error"]),
  );
}