PostRecord constructor

  1. @JsonSerializable(includeIfNull: false)
const PostRecord({
  1. @Default(appBskyFeedPost) @JsonKey(name: r'$type') String $type,
  2. required String text,
  3. @FacetConverter() List<Facet>? facets,
  4. @ReplyRefConverter() ReplyRef? reply,
  5. @UPostEmbedConverter() UPostEmbed? embed,
  6. List<String>? langs,
  7. @UPostLabelConverter() UPostLabel? labels,
  8. List<String>? tags,
  9. required DateTime createdAt,
  10. @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory PostRecord({
  /// The unique namespace for this lex object.
  ///
  /// `app.bsky.feed.post`
  @Default(appBskyFeedPost) @JsonKey(name: r'$type') String $type,

  /// The primary post content. May be an empty string, if there are
  /// embeds.
  required String text,

  /// Annotations of text (mentions, URLs, hashtags, etc)
  @FacetConverter() List<Facet>? facets,
  @ReplyRefConverter() ReplyRef? reply,
  @UPostEmbedConverter() UPostEmbed? embed,

  /// Indicates human language of post primary text content.
  List<String>? langs,

  /// Self-label values for this post. Effectively content warnings.
  @UPostLabelConverter() UPostLabel? labels,

  /// Additional hashtags, in addition to any included in post text and
  /// facets.
  List<String>? tags,

  /// Client-declared timestamp when this post was originally created.
  required DateTime createdAt,

  /// Contains unknown objects not defined in Lexicon.
  @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
}) = _PostRecord;