toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => {
      'audio_url': audioUrl,
      'author_icon': authorIcon,
      'author_link': authorLink,
      'author_name': authorName,
      'collapsed': collapsed,
      'color': color,
      'fields': fields
              ?.where((json) => json != null)
              ?.map((field) => field.toMap())
              ?.toList() ??
          [],
      'image_url': imageUrl,
      'message_link': messageLink,
      'text': text,
      'thumb_url': thumbUrl,
      'title': title,
      'title_link': titleLink,
      'title_link_download': titleLinkDownload,
      'ts': ts != null ? ts!.toIso8601String() : null,
      'video_url': videoUrl,
    };