toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'description': description,
'type': type.value,
'status': status.value,
'startDate': startDate.toIso8601String(),
'endDate': endDate.toIso8601String(),
'tasks': tasks?.map((e) => e.toJson()).toList(),
'communityRewards': communityRewards?.map((e) => e.toJson()).toList(),
'totalCommunityXp': totalCommunityXp,
'participantCount': participantCount,
'isJoined': isJoined,
'userXp': userXp,
'userRank': userRank,
'createdAt': createdAt?.toIso8601String(),
'updatedAt': updatedAt?.toIso8601String(),
};
}