toJson method
Implementation
Map<String, dynamic> toJson() => {
'creator_id': creatorId,
'title': title,
'category': category,
'image_url': imageUrl,
'content': content,
'likes': likes,
'liked_by': likedBy,
'reaction': reaction,
// reactions is a list of maps so we need to convert it to a map
'reactions': reactions?.map((e) => e.toJson()).toList() ?? [],
'created_at': createdAt.toIso8601String(),
'reaction_enabled': reactionEnabled,
'data': data,
};