toJson method
Implementation
Map<String, dynamic> toJson() {
final _data = {
'id': id,
'owner_id': ownerId,
'type': type.index,
'caption': caption,
'files': files.map((e) => e.toJson()).toList(),
'search_keys': searchKeys,
'featured': featured,
'reactions_count': reactionsCount,
'comments_count': commentsCount,
'replies_count': repliesCount,
'saves_count': savesCount,
'shares_count': sharesCount,
'views_count': viewsCount,
'updated_at': updatedAt,
'created_at': createdAt,
'visibility': visibility,
...extraData,
};
_data.removeWhere((key, value) => value == null);
return _data;
}