ThreadPost class final
One post of a thread, exactly as its author wrote it.
This mirrors the record fields of app.bsky.feed.post minus the three the
thread owns: reply is derived from this post's position in the thread,
createdAt is assigned by ThreadBatch.build, and the record key is a
freshly generated TID. Letting a caller set any of those would let it
contradict the chain the batch is built to guarantee.
facets are lexicon models, as in feed.post.create. Use
bluesky.feed.buildPostText to produce both fields from plain text:
final built = await bluesky.feed.buildPostText(text);
final post = ThreadPost(text: built.text, facets: built.facets);
Note that built.text -- not the original string -- is what must be
posted: facet indices are byte offsets into the formatted text, which is
why PostText carries the two together.
Constructors
-
ThreadPost({required String text, List<
RichtextFacet> ? facets, UFeedPostEmbed? embed, List<String> ? langs, UFeedPostLabels? labels, List<String> ? tags, Map<String, dynamic> ? $unknown}) -
Returns a new ThreadPost.
const
Properties
-
$unknown
→ Map<
String, dynamic> ? -
Fields outside the lexicon, written as top-level record keys.
final
- embed → UFeedPostEmbed?
-
The images, video, external link, or quoted record attached to this post.
final
-
facets
→ List<
RichtextFacet> ? -
Annotations of text -- mentions, links and tags.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- labels → UFeedPostLabels?
-
Self-labels applied to this post.
final
-
langs
→ List<
String> ? -
The languages this post is written in.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Additional hashtags, in addition to any included in text as facets.
final
- text → String
-
The primary post content. May be an empty string, if there are embeds.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited