fromJson method Null safety

DocumentReaderDocumentType? fromJson(
  1. dynamic jsonObject
)

Implementation

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

  result.pageIndex = jsonObject["pageIndex"];
  result.documentID = jsonObject["documentID"];
  result.dType = jsonObject["dType"];
  result.dFormat = jsonObject["dFormat"];
  result.dMRZ = jsonObject["dMRZ"];
  result.name = jsonObject["name"];
  result.ICAOCode = jsonObject["ICAOCode"];
  result.dDescription = jsonObject["dDescription"];
  result.dYear = jsonObject["dYear"];
  result.dCountryName = jsonObject["dCountryName"];
  if (jsonObject["FDSID"] != null)
    for (var item in jsonObject["FDSID"])
      result.FDSID.add(item);

  return result;
}