toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (notAfter != null) result.addAll({"notAfter": notAfter});
  if (notBefore != null) result.addAll({"notBefore": notBefore});

  return result;
}