Blog/Flutter SDK

GVL Comments Flutter SDK 1.0.0 — What's New

By Joris Obert6 min read

After months of iteration with early testers, the gvl_comments Flutter package reaches 1.0.0. The public API is now frozen under semantic versioning — no more breaking changes without a major bump.

This release brings threaded replies, five locales, two new standalone widgets, a prefetch API for feeds, and a cleaner data model. Here's the full rundown.

Threaded Replies (Depth 2)

Comments can now have one level of nested replies. Each CommentModel carries parentId, replyToCommentId, and replyToUserId fields. The GvlCommentsList widget renders replies inline with an indented layout — no extra setup needed.

GvlCommentsList(
  threadKey: 'post:5YqL4w8bQm9ZkF3R7sN2D',
  user: currentUser,
  // Replies are rendered automatically.
  // Users tap a "Reply" action on any comment.
)

5 Locales Out of the Box

The SDK now ships with English, French, German, Spanish, and Portuguese translations. Every string in the UI — reaction labels, error messages, composer hints, moderation notices — goes through the GvlCommentsL10n system.

MaterialApp(
  localizationsDelegates: GvlCommentsL10n.localizationsDelegates,
  supportedLocales: GvlCommentsL10n.supportedLocales,
  // Picks the right locale automatically.
)

Need a locale that isn't shipped? You can provide your own GvlCommentsL10n subclass — every string is overridable.

New Widgets: TopComment & CommentCount

Not every screen needs the full comment thread. Two new standalone widgets let you surface comments anywhere in your app:

TopComment

Shows the most-engaged comment for a thread. Useful on feed cards, article previews, or product pages — a social proof snippet without the full list.

TopComment(
  threadKey: 'post:5YqL4w8bQm9ZkF3R7sN2D',
  // Optional: builder, loadingBuilder, emptyBuilder, errorBuilder
)

CommentCount

Displays the approved comment count for a thread. Reads from cache when prefetchThreads was called — zero latency in that case.

CommentCount(
  threadKey: 'post:5YqL4w8bQm9ZkF3R7sN2D',
  builder: (context, count) => Text('$count comments'),
)

Prefetch API for Feeds & Lists

If your app shows a list of articles or products, each with a comment count or top comment, fetching them one by one creates a waterfall of requests. The new prefetchThreads API batch-loads thread info in a single call:

// In your feed screen's initState or FutureBuilder:
await CommentsKit.I().prefetchThreads(
  threadKeys: ['post:abc...', 'post:def...', 'post:ghi...'],
  user: currentUser,
);

// Then TopComment and CommentCount read from cache — zero latency.

The result is cached in memory. Subsequent TopComment and CommentCount widgets for those threads render instantly without an additional network call.

Type-Safe Moderation with CommentStatus

The old string-based status ("pending", "approved", "rejected") is replaced by a proper Dart enum:

if (comment.commentStatus == CommentStatus.approved) {
  // type-safe, exhaustive switch possible
}

// The legacy comment.status String getter still works,
// but is deprecated and will be removed in 2.0.

Same goes for reactions: a Reaction enum with like, love, laugh, wow, sad, angry and helpers like reaction.emoji and Reaction.emojiFor('like').

Breaking Changes & Migration

Two breaking changes to be aware of when upgrading from 0.9.x:

  • CommentModel.status is now a CommentStatus enum. If you were comparing strings (comment.status == 'approved'), switch to comment.commentStatus == CommentStatus.approved. The old .status String getter is still available but deprecated.
  • GvlCommentsStrings.fr() removed — the old manual string factory is gone. Use the standard Flutter l10n system (GvlCommentsL10n) instead, which now covers French and four other languages.

The legacy CommentsClient class and its associated types (Comment, CommentsExternalUser, CommentsUserRole) are deprecated. They still work in 1.0 but will be removed in 2.0. Use CommentsKit and the modern models going forward.

Other Improvements

  • HTTP timeout — all API calls now have a 15-second timeout to prevent indefinite hangs on poor connections
  • LoadMoreButtonBuilder — fully customize the pagination button in GvlCommentsList
  • Body validation constants CommentsKit.minBodyLength (1) and CommentsKit.maxBodyLength (5000) are now exposed publicly for input validation
  • iOS podspec fix — resolved a duplicate Pod::Spec.new block that caused warnings
  • .pubignore — smaller package size on pub.dev (screenshots and scripts excluded)

How to Upgrade

# pubspec.yaml
dependencies:
  gvl_comments: ^1.0.0
flutter pub upgrade gvl_comments

If you're coming from 0.9.x, check the two breaking changes above. For most apps, the upgrade is a version bump with no code changes — the deprecated APIs continue to work.

Try gvl_comments 1.0.0

Add a production-ready comment system to your Flutter app in minutes. Free tier, no credit card.