bluesky_text_flutter 0.1.0
bluesky_text_flutter: ^0.1.0 copied to clipboard
Flutter widgets for bluesky_text — a rich-text editing controller that highlights entities and the over-limit tail as you type, and a viewer for fetched posts.
Flutter widgets for bluesky_text 🦋
bluesky_text_flutter #
The "last mile" Flutter layer on top of
bluesky_text: drop-in widgets for the
two things every Bluesky client needs — a rich-text composer and a
post viewer — so you never hand-roll TextSpan trees or manage
GestureRecognizer lifecycles yourself.
Features ⭐ #
- ✅
BlueskyTextEditingController— live-highlights entities (handles, links, tags) and the over-limit tail as the user types, in one pass per keystroke. Keeps the IME composing underline. Exposesoverflowfor a character counter. - ✅
BlueskyRichText— renders a fetched post from its authoritative server facets (mentions carry their DID) with tappable mentions, links and tags. Recognizers are owned and disposed by the widget — no leaks. - ✅ Re-exports all of
bluesky_text, so you import a single package.
Composer #
final controller = BlueskyTextEditingController();
TextField(
controller: controller,
maxLines: null,
);
// Character counter:
final overflow = controller.overflow; // null when within the 300 / 3000 limit
Entities default to the theme's primary color and the over-limit tail to the
error color; override with entityStyle, overflowStyle, or a full
styleBuilder.
Viewer #
BlueskyRichText(
text: post.record.text,
facets: post.record.facets
?.map((f) => PostFacet.fromJson(f.toJson()))
.toList() ??
const [],
onMentionTap: (did) => context.go('/profile/$did'),
onLinkTap: (uri) => launchUrlString(uri),
onTagTap: (tag) => context.go('/tag/$tag'),
);
Getting Started 💪 #
dependencies:
bluesky_text_flutter: ^0.1.0
See example/lib/main.dart for a runnable demo of both
widgets.