Skip to main content

Flutter SDK (sdk/flutter/) Changes Review

Base: commit 5e4976de (state before the improvements branch)
Target: commit 9feb900b (tip of docs/flutter-sdk-improvments)
Scope: sdk/flutter/*.mdx only, sdk/flutter/3.0/ excluded
Total: 62 files modified (+8,176 lines, −16 lines)
Commits:
  • 659f8839 — “feat: made docs more agentic and developer friendly” (added Quick Reference <Info> blocks, description frontmatter, <Warning> blocks, <Note> blocks, and Next Steps <CardGroup> navigation to all files)
  • beb0cc1c — “docs(flutter): add response and error accordions to SDK docs” (added <Accordion title="Response"> and <Accordion title="Error"> sections after every SDK method call across all files except presenter-mode)
  • 9feb900b — “docs(flutter): add response and error accordions to presenter mode” (added response/error accordions to the final remaining file)

What Changed Across All Files — Pattern Summary

Every file received some combination of these five additions:

1. description frontmatter (all 62 files)

A one-line SEO description was added to the YAML frontmatter of every file. Example:

2. AI Agent Quick Reference <Info> blocks (all 62 files)

A hidden comment {/* TL;DR for Agents and Quick Reference */} followed by an <Info> block containing copy-paste-ready Dart/YAML code snippets was added at the top of every page, right after the frontmatter. These blocks are designed for both AI agents and developers to quickly understand the page’s core functionality without reading the full content. Example from overview.mdx:

3. Response/Error Accordions (most files — wherever SDK methods exist)

After every SDK method call on the page, two expandable <Accordion> sections were added:
  • <Accordion title="Response"> — Documents the success callback return type with a table of fields including Parameter, Type, Description, and Sample Value. For complex objects (User, Group, BaseMessage, Call), every field is listed with realistic sample values.
  • <Accordion title="Error"> — Documents the error callback with code, message, and details fields and sample error values.
Example Response table fields for sendMessage(): id, metadata, receiver, editedBy, conversationId, sentAt, receiverUid, type, readAt, deletedBy, deliveredAt, deletedAt, replyCount, sender, receiverType, editedAt, parentMessageId, readByMeAt, category, deliveredToMeAt, updatedAt, text, tags, unreadRepliesCount, mentionedUsers, hasMentionedMe, reactions, moderationStatus, quotedMessageId — plus nested Sender and Receiver User object tables. Example Error table:

4. <Warning> blocks (select files — where common pitfalls exist)

Warning callouts were added for critical developer pitfalls. Examples:
  • overview.mdx / setup.mdx: CometChat.init() must be called before any other SDK method. Calling login(), sendMessage(), or registering listeners before init() will fail.”
  • authentication-overview.mdx: “Auth Key is for development/testing only. In production, generate Auth Tokens server-side.”
  • delete-message.mdx / delete-conversation.mdx / delete-group.mdx: Warnings about permanent/irreversible deletion
  • default-call.mdx: “Generate a call token before starting a session”
  • ai-agents.mdx: “Always remove AI Assistant listeners when they’re no longer needed (e.g., on widget dispose or page navigation). Failing to remove listeners can cause memory leaks and duplicate event handling.”
  • receive-messages.mdx: Warning about removing message listeners on dispose

5. Next Steps <CardGroup> navigation (all 62 files)

A --- horizontal rule followed by a ## Next Steps heading and a <CardGroup cols={2}> with 2–4 <Card> links was added at the bottom of every page. Each card has a title, icon, href, and description pointing to logically related pages.

Detailed File-by-File Changes