PostAggregates constructor

const PostAggregates({
  1. @JsonKey.new(name: 'post_id') required int postId,
  2. @Default.new(0) int comments,
  3. @Default.new(0) int score,
  4. @Default.new(0) int upvotes,
  5. @Default.new(0) int downvotes,
  6. @JsonKey.new(name: 'newest_comment_time') DateTime? newestCommentTime,
  7. @JsonKey.new(name: 'newest_comment_time_necro') DateTime? newestCommentTimeNecro,
})

Implementation

const factory PostAggregates({
  @JsonKey(name: 'post_id') required int postId,
  @Default(0) int comments,
  @Default(0) int score,
  @Default(0) int upvotes,
  @Default(0) int downvotes,
  @JsonKey(name: 'newest_comment_time') DateTime? newestCommentTime,
  @JsonKey(name: 'newest_comment_time_necro') DateTime? newestCommentTimeNecro,
}) = _PostAggregates;