PostView constructor

const PostView({
  1. @Default.new('app.bsky.feed.defs#postView') String $type,
  2. @AtUriConverter.new() required AtUri uri,
  3. required String cid,
  4. @ProfileViewBasicConverter() required ProfileViewBasic author,
  5. required Map<String, dynamic> record,
  6. @UPostViewEmbedConverter() UPostViewEmbed? embed,
  7. int? bookmarkCount,
  8. int? replyCount,
  9. int? repostCount,
  10. int? likeCount,
  11. int? quoteCount,
  12. int? viewCount,
  13. @JsonKey.new(toJson: iso8601) required DateTime indexedAt,
  14. @ViewerStateConverter() ViewerState? viewer,
  15. @LabelConverter() List<Label>? labels,
  16. @ThreadgateViewConverter() ThreadgateView? threadgate,
  17. Map<String, dynamic>? debug,
  18. Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory PostView({
  @Default('app.bsky.feed.defs#postView') String $type,
  @AtUriConverter() required AtUri uri,
  required String cid,
  @ProfileViewBasicConverter() required ProfileViewBasic author,
  required Map<String, dynamic> record,
  @UPostViewEmbedConverter() UPostViewEmbed? embed,
  int? bookmarkCount,
  int? replyCount,
  int? repostCount,
  int? likeCount,
  int? quoteCount,

  /// Approximate number of times the post has been viewed. Only included in authenticated responses to the post's author when eligible to see the count. Counts less than 100 are omitted.
  int? viewCount,
  @JsonKey(toJson: iso8601) required DateTime indexedAt,
  @ViewerStateConverter() ViewerState? viewer,
  @LabelConverter() List<Label>? labels,
  @ThreadgateViewConverter() ThreadgateView? threadgate,
  Map<String, dynamic>? debug,

  Map<String, dynamic>? $unknown,
}) = _PostView;