toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (pageIndex != null) result.addAll({"pageIndex": pageIndex});
  if (documentID != null) result.addAll({"documentID": documentID});
  if (dType != null) result.addAll({"dType": dType});
  if (dFormat != null) result.addAll({"dFormat": dFormat});
  if (dMRZ != null) result.addAll({"dMRZ": dMRZ});
  if (name != null) result.addAll({"name": name});
  if (ICAOCode != null) result.addAll({"ICAOCode": ICAOCode});
  if (dDescription != null) result.addAll({"dDescription": dDescription});
  if (dYear != null) result.addAll({"dYear": dYear});
  if (dCountryName != null) result.addAll({"dCountryName": dCountryName});
  if (FDSID != null) result.addAll({"FDSID": FDSID});

  return result;
}