toJson method

Map<String, String>? toJson()

Implementation

Map<String, String>? toJson() {
  Map<String, String> map = {};
  if (title != null) {
    map['title'] = title!;
  }

  if (description != null) {
    map['description'] = description!;
  }

  if (imageUrl != null) {
    map['imageUrl'] = imageUrl!;
  }

  if (url != null) {
    map['url'] = url!;
  }

  return map.isEmpty ? null : map;
}