fromJson static method

Results? fromJson(
  1. dynamic jsonObject
)

Allows you to deserialize object.

Implementation

static Results? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  var result = Results();

  result._chipPage = jsonObject["chipPage"];
  result._processingFinishedStatus = ProcessingFinishedStatus.getByValue(
      jsonObject["processingFinishedStatus"])!;
  result._elapsedTime = jsonObject["elapsedTime"];
  result._elapsedTimeRFID = jsonObject["elapsedTimeRFID"];
  result._morePagesAvailable = jsonObject["morePagesAvailable"];
  result._graphicResult = GraphicResult.fromJson(jsonObject["graphicResult"]);
  result._textResult = TextResult.fromJson(jsonObject["textResult"]);
  if (jsonObject["documentPosition"] != null) {
    result._documentPosition = [];
    for (var item in jsonObject["documentPosition"]) {
      result._documentPosition!.addSafe(Position.fromJson(item));
    }
  }
  if (jsonObject["barcodePosition"] != null) {
    result._barcodePosition = [];
    for (var item in jsonObject["barcodePosition"]) {
      result._barcodePosition!.addSafe(Position.fromJson(item));
    }
  }
  if (jsonObject["mrzPosition"] != null) {
    result._mrzPosition = [];
    for (var item in jsonObject["mrzPosition"]) {
      result._mrzPosition!.addSafe(Position.fromJson(item));
    }
  }
  if (jsonObject["imageQuality"] != null) {
    result._imageQuality = [];
    for (var item in jsonObject["imageQuality"]) {
      result._imageQuality!.addSafe(ImageQualityGroup.fromJson(item));
    }
  }
  if (jsonObject["documentType"] != null) {
    result._documentType = [];
    for (var item in jsonObject["documentType"]) {
      result._documentType!.addSafe(DocumentType.fromJson(item));
    }
  }
  result._rawResult = jsonObject["rawResult"];
  result._rfidSessionData =
      RFIDSessionData.fromJson(jsonObject["rfidSessionData"]);
  result._authenticityResult =
      AuthenticityResult.fromJson(jsonObject["authenticityResult"]);
  result._barcodeResult = BarcodeResult.fromJson(jsonObject["barcodeResult"]);
  result._status = ResultsStatus.fromJson(jsonObject["status"])!;
  result._vdsncData = VDSNCData.fromJson(jsonObject["vdsncData"]);
  result._transactionInfo =
      TransactionInfo.fromJson(jsonObject["transactionInfo"]);

  return result;
}