toJson method

Map<String, dynamic> toJson()

Converts this object to a JSON-compatible map suitable for SDK calls.

Fields that are null are omitted from the resulting map. Images are left in the representation expected by the underlying native API.

Returns

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = <String, dynamic>{};
  if (address != null) {
    json['address'] = address!.pointerId;
  }
  if (image != null) {
    json['image'] = image;
  }
  if (coordinates != null) {
    json['coordinates'] = coordinates;
  }
  if (name != null) {
    json['name'] = name;
  }
  if (description != null) {
    json['description'] = description;
  }
  if (author != null) {
    json['author'] = author;
  }
  if (extrainfo != null) {
    json['extraInfo'] = extrainfo!.toInputFormat();
  }
  return json;
}