agentsclimarketplace

Cometchat flutter v5 conversations

Skill cometchat/cometchat-skills/skills/cometchat-flutter-v5-conversations

Use when working with CometChat Flutter UIKit v5 conversation list component. Triggers on CometChatConversations, conversation list, recent chats.From its SKILL.md

Install
npx -y skills add cometchat/cometchat-skills --skill cometchat-flutter-v5-conversations

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Ground truth: cometchat_chat_uikit: ^5.2 (legacy/maintenance-only; calls via raw cometchat_calls_sdk ^5.0.2) — pub-cache source + ui-kit/flutter/v5. Official docs: https://www.cometchat.com/docs/ui-kit/flutter/v5/overview · Docs MCP: claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.

CometChat Flutter UIKit v5 — Conversations

The CometChatConversations component displays a list of recent conversations.

Key Props

PropTypeDefaultDescription
conversationsRequestBuilderConversationsRequestBuilder?—Custom fetch builder
conversationsStyleCometChatConversationsStyleconst CometChatConversationsStyle()Visual styling
onItemTapFunction(Conversation)?—Tap callback (no BuildContext)
onItemLongPressFunction(Conversation)?—Long press callback
subtitleViewWidget? Function(BuildContext, Conversation)?—Custom subtitle
listItemViewWidget Function(Conversation)?—Custom list item (replaces the whole row)
leadingViewWidget? Function(BuildContext, Conversation)?—Custom leading widget (avatar slot)
titleViewWidget? Function(BuildContext, Conversation)?—Custom title widget
trailingViewWidget? Function(Conversation)?—Custom trailing widget (single-arg — asymmetric with the other slots)
titleString?—List title
showBackButtonboolfalseShow back button
onBackVoidCallback?—Back button callback
hideAppbarbool?falseHide app bar
appBarOptionsList<Widget>?—App bar trailing widgets
usersStatusVisibilitybool?trueShow online status
receiptsVisibilitybool?trueShow read receipts
textFormattersList<CometChatTextFormatter>?—Text formatters for subtitles
controllerTagString?—Custom GetX controller tag
hideSearchbool?—Hide search bar
searchReadOnlyboolfalseRead-only search
onSearchTapGestureTapCallback?—Search tap callback
deleteConversationOptionVisibilitybool?trueShow delete option
loadingStateViewWidgetBuilder?—Custom loading state
emptyStateViewWidgetBuilder?—Custom empty state
errorStateViewWidgetBuilder?—Custom error state
setOptionsFunction?—Replace long-press options
addOptionsFunction?—Add to long-press options

Basic Usage

CometChatConversations(
  onItemTap: (conversation) {
    User? user;
    Group? group;
    if (conversation.conversationWith is User) {
      user = conversation.conversationWith as User;
    } else {
      group = conversation.conversationWith as Group;
    }
    Navigator.push(context, MaterialPageRoute(
      builder: (_) => MessagesScreen(user: user, group: group),
    ));
  },
)

Custom Request Builder

CometChatConversations(
  conversationsRequestBuilder: ConversationsRequestBuilder()
    ..limit = 30
    ..conversationType = ConversationType.user,
)

Internal Architecture (GetX)

The component creates CometChatConversationsController via Get.put() in initState() and deletes it in dispose() (unless controllerTag is provided externally).

Theme values are cached in didChangeDependencies() (unconditionally, no flag):

@override
void didChangeDependencies() {
  typography = CometChatThemeHelper.getTypography(context);
  colorPalette = CometChatThemeHelper.getColorPalette(context);
  spacing = CometChatThemeHelper.getSpacing(context);
  style = CometChatThemeHelper.getTheme<CometChatConversationsStyle>(
      context: context, defaultTheme: CometChatConversationsStyle.of)
    .merge(widget.conversationsStyle);
  super.didChangeDependencies();
}

Anti-Patterns

// ❌ WRONG — trying to access controller before component mounts
final controller = Get.find<CometChatConversationsController>();

// ❌ WRONG — manually creating controller outside the widget
Get.put(CometChatConversationsController(...));

// ❌ WRONG — not extracting User/Group from conversation
onItemTap: (conversation) {
  Navigator.push(context, MaterialPageRoute(
    builder: (_) => MessagesScreen(user: conversation.conversationWith), // Type error
  ));
}

Checklist — Conversations

  • onItemTap extracts User/Group from conversation.conversationWith with type check
  • Navigation to messages screen passes extracted user or group
  • Let the widget manage its own GetX controller lifecycle

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.