fromJson static method

RFIDSessionData? fromJson(
  1. dynamic jsonObject
)

Allows you to deserialize object.

Implementation

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

  result._totalBytesReceived = jsonObject["totalBytesReceived"];
  result._totalBytesSent = jsonObject["totalBytesSent"];
  result._status = RFIDErrorCodes.getByValue(jsonObject["status"])!;
  result._extLeSupport =
      RFIDErrorCodes.getByValue(jsonObject["extLeSupport"])!;
  result._processTime = jsonObject["processTime"];
  result._cardProperties =
      CardProperties.fromJson(jsonObject["cardProperties"]);
  for (var item in jsonObject["accessControls"]) {
    result._accessControls.addSafe(AccessControlProcedureType.fromJson(item));
  }
  for (var item in jsonObject["applications"]) {
    result._applications.addSafe(Application.fromJson(item));
  }
  for (var item in jsonObject["securityObjects"]) {
    result._securityObjects.addSafe(SecurityObject.fromJson(item));
  }
  for (var item in jsonObject["dataFields"]) {
    result._dataFields.addSafe(DataField.fromJson(item));
  }
  if (jsonObject["dataGroups"] != null) {
    result._dataGroups = [];
    for (var item in jsonObject["dataGroups"]) {
      result._dataGroups!.addSafe(RFIDDataFileType.getByValue(item));
    }
  }

  return result;
}