toJson method
Implementation
Map<String, dynamic> toJson() {
final attachment = <String, dynamic>{};
if (authorIcon != null) attachment['author_icon'] = authorIcon;
if (authorLink != null) attachment['author_link'] = authorLink;
if (authorName != null) attachment['author_name'] = authorName;
if (color != null) attachment['color'] = color;
if (fallback != null) attachment['fallback'] = fallback;
if (fields != null) attachment['fields'] = fields;
if (footer != null) attachment['footer'] = footer;
if (footerIcon != null) attachment['footer_icon'] = footerIcon;
if (imageUrl != null) attachment['image_url'] = imageUrl;
if (pretext != null) attachment['pretext'] = pretext;
if (text != null) attachment['text'] = text;
if (thumbUrl != null) attachment['thumb_url'] = thumbUrl;
if (title != null) attachment['title'] = title;
if (titleLink != null) attachment['title_link'] = titleLink;
if (ts != null) attachment['ts'] = ts;
return attachment;
}