toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (AA != null) result.addAll({"AA": AA});
  if (BAC != null) result.addAll({"BAC": BAC});
  if (CA != null) result.addAll({"CA": CA});
  if (PA != null) result.addAll({"PA": PA});
  if (PACE != null) result.addAll({"PACE": PACE});
  if (TA != null) result.addAll({"TA": TA});
  if (overallStatus != null) result.addAll({"overallStatus": overallStatus});

  return result;
}