toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (fieldType != null) result.addAll({"fieldType": fieldType});
  if (lcid != null) result.addAll({"lcid": lcid});
  if (status != null) result.addAll({"status": status});
  if (lcidName != null) result.addAll({"lcidName": lcidName});
  if (fieldName != null) result.addAll({"fieldName": fieldName});
  if (value != null) result.addAll({"value": value});
  if (values != null) result.addAll({"values": values});

  return result;
}