Post constructor

Post({
  1. required int id,
  2. required String title,
  3. required String content,
  4. String? image,
  5. bool? isPinned,
  6. bool? isApproved,
  7. int likesCount = 0,
  8. int commentsCount = 0,
  9. required CommunityUser user,
  10. required Community community,
  11. required bool isLikedByUser,
  12. required DateTime createdAt,
  13. required DateTime updatedAt,
})

Implementation

Post({
  required this.id,
  required this.title,
  required this.content,
  this.image,
  this.isPinned,
  this.isApproved,
  this.likesCount = 0,
  this.commentsCount = 0,
  required this.user,
  required this.community,
  required this.isLikedByUser,
  required this.createdAt,
  required this.updatedAt,
});