@cometchat/skills 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -17
- package/bin/install.js +389 -43
- package/package.json +19 -9
- package/skills/cometchat/SKILL.md +1066 -265
- package/skills/cometchat-android-v5/SKILL.md +120 -0
- package/skills/cometchat-android-v5-components/SKILL.md +430 -0
- package/skills/cometchat-android-v5-core/SKILL.md +468 -0
- package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
- package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
- package/skills/cometchat-android-v5-features/SKILL.md +130 -0
- package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
- package/skills/cometchat-android-v5-production/SKILL.md +94 -0
- package/skills/cometchat-android-v5-push/SKILL.md +620 -0
- package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
- package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
- package/skills/cometchat-android-v6/SKILL.md +107 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
- package/skills/cometchat-android-v6-core/SKILL.md +354 -0
- package/skills/cometchat-android-v6-events/SKILL.md +212 -0
- package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
- package/skills/cometchat-android-v6-features/SKILL.md +130 -0
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
- package/skills/cometchat-android-v6-production/SKILL.md +187 -0
- package/skills/cometchat-android-v6-push/SKILL.md +274 -0
- package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
- package/skills/cometchat-angular-components/SKILL.md +706 -0
- package/skills/cometchat-angular-core/SKILL.md +444 -0
- package/skills/cometchat-angular-customization/SKILL.md +424 -0
- package/skills/cometchat-angular-features/SKILL.md +447 -0
- package/skills/cometchat-angular-patterns/SKILL.md +447 -0
- package/skills/cometchat-angular-placement/SKILL.md +685 -0
- package/skills/cometchat-angular-production/SKILL.md +415 -0
- package/skills/cometchat-angular-theming/SKILL.md +365 -0
- package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
- package/skills/cometchat-astro-patterns/SKILL.md +3 -3
- package/skills/cometchat-components/SKILL.md +11 -0
- package/skills/cometchat-core/SKILL.md +11 -6
- package/skills/cometchat-customization/references/component-catalog.md +1 -1
- package/skills/cometchat-features/SKILL.md +176 -108
- package/skills/cometchat-flutter-v5/SKILL.md +167 -0
- package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
- package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
- package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
- package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
- package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
- package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
- package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
- package/skills/cometchat-flutter-v6/SKILL.md +445 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
- package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
- package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
- package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
- package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
- package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
- package/skills/cometchat-ios/SKILL.md +323 -0
- package/skills/cometchat-ios-components/SKILL.md +651 -0
- package/skills/cometchat-ios-core/SKILL.md +822 -0
- package/skills/cometchat-ios-customization/SKILL.md +825 -0
- package/skills/cometchat-ios-features/SKILL.md +725 -0
- package/skills/cometchat-ios-placement/SKILL.md +750 -0
- package/skills/cometchat-ios-production/SKILL.md +730 -0
- package/skills/cometchat-ios-push/SKILL.md +582 -0
- package/skills/cometchat-ios-theming/SKILL.md +631 -0
- package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
- package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
- package/skills/cometchat-native-components/SKILL.md +594 -0
- package/skills/cometchat-native-core/SKILL.md +407 -0
- package/skills/cometchat-native-customization/SKILL.md +594 -0
- package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
- package/skills/cometchat-native-features/SKILL.md +608 -0
- package/skills/cometchat-native-placement/SKILL.md +500 -0
- package/skills/cometchat-native-production/SKILL.md +694 -0
- package/skills/cometchat-native-push/SKILL.md +593 -0
- package/skills/cometchat-native-testing/SKILL.md +583 -0
- package/skills/cometchat-native-theming/SKILL.md +656 -0
- package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
- package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
- package/skills/cometchat-production/SKILL.md +60 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-flutter-v6-components
|
|
3
|
+
description: >
|
|
4
|
+
Complete catalog of CometChat Flutter UI Kit v6 widgets. Reference before writing
|
|
5
|
+
integration code — never invent widget names. Covers all chat components
|
|
6
|
+
(conversations, messages, users, groups), call components (buttons, incoming,
|
|
7
|
+
outgoing, ongoing, call logs), and shared views (avatar, badge, receipt, reactions,
|
|
8
|
+
bubbles, list base, search, status indicator).
|
|
9
|
+
license: "MIT"
|
|
10
|
+
compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter >=2.5.0"
|
|
11
|
+
allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
|
|
12
|
+
metadata:
|
|
13
|
+
author: "CometChat"
|
|
14
|
+
version: "3.0.0"
|
|
15
|
+
tags: "cometchat flutter components widgets catalog props"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# CometChat Flutter UIKit v6 — Widget Catalog
|
|
19
|
+
|
|
20
|
+
Canonical reference for every public widget in `cometchat_chat_uikit`. Look up names, props, view slots, and style classes here before writing code.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Rule: NEVER_INVENT_NAMES
|
|
25
|
+
|
|
26
|
+
Always use exact widget names from this catalog. Do not invent names like `CometChatChat`, `CometChatMessenger`, `CometChatChatList`, `CometChatContactList`, `CometChatMessageView`, or `CometChatUserList` — they don't exist.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 1. Chat Components
|
|
31
|
+
|
|
32
|
+
### CometChatConversations
|
|
33
|
+
|
|
34
|
+
Displays a list of recent conversations with real-time updates (new messages, typing, presence, receipts).
|
|
35
|
+
|
|
36
|
+
- **Location:** `chat_ui/src/conversations/cometchat_conversations.dart`
|
|
37
|
+
- **Key props:** `onItemTap`, `onItemLongPress`, `conversationsRequestBuilder`, `usersStatusVisibility`, `receiptsVisibility`, `deleteConversationOptionVisibility`, `textFormatters`, `hideAppbar`, `hideSearch`, `conversationsBloc`
|
|
38
|
+
- **View slots:** `listItemView(Conversation)`, `subtitleView(ctx, Conversation)`, `trailingView(Conversation)`, `leadingView(ctx, Conversation)`, `titleView(ctx, Conversation)`, `emptyStateView`, `errorStateView`, `loadingStateView`
|
|
39
|
+
- **Style:** `CometChatConversationsStyle`
|
|
40
|
+
- **Request builder:** `ConversationsRequestBuilder`
|
|
41
|
+
|
|
42
|
+
### CometChatMessageList
|
|
43
|
+
|
|
44
|
+
Displays messages for a 1:1 or group conversation with real-time updates, reactions, threads, and smart replies.
|
|
45
|
+
|
|
46
|
+
- **Location:** `chat_ui/src/message_list/widgets/cometchat_message_list.dart`
|
|
47
|
+
- **Key props:** `user`, `group`, `messagesRequestBuilder`, `parentMessageId`, `templates`, `alignment`, `hideDeletedMessages`, `disableReceipts`, `disableReactions`, `enableSwipeToReply`, `textFormatters`, `messageListBloc`
|
|
48
|
+
- **View slots:** `headerView`, `footerView`, `emptyStateView`, `errorStateView`, `loadingStateView`, `emptyChatGreetingView`
|
|
49
|
+
- **Style:** `CometChatMessageListStyle`
|
|
50
|
+
- **Request builder:** `MessagesRequestBuilder`
|
|
51
|
+
|
|
52
|
+
### CometChatMessageComposer
|
|
53
|
+
|
|
54
|
+
Text input with attachments, voice recording, rich text toolbar, mentions, and AI features.
|
|
55
|
+
|
|
56
|
+
- **Location:** `chat_ui/src/message_composer/widgets/cometchat_message_composer.dart`
|
|
57
|
+
- **Key props:** `user`, `group`, `parentMessageId`, `placeholderText`, `disableTypingEvents`, `text`, `onChange`, `onSendButtonTap`, `textFormatters`, `disableMentions`, `hideVoiceRecordingButton`, `richTextConfiguration`
|
|
58
|
+
- **View slots:** `auxiliaryButtonView`, `secondaryButtonView`, `sendButtonView`, `headerView`, `footerView`, `richTextToolbarView`
|
|
59
|
+
- **Style:** `CometChatMessageComposerStyle`
|
|
60
|
+
- **Note:** Scaffold must set `resizeToAvoidBottomInset: false` — composer handles keyboard internally.
|
|
61
|
+
|
|
62
|
+
### CometChatMessageHeader
|
|
63
|
+
|
|
64
|
+
Displays user/group info as an AppBar with online status, typing indicator, and call buttons.
|
|
65
|
+
|
|
66
|
+
- **Location:** `chat_ui/src/message_header/cometchat_message_header.dart`
|
|
67
|
+
- **Key props:** `user`, `group`, `onBack`, `showBackButton`, `hideVideoCallButton`, `hideVoiceCallButton`, `usersStatusVisibility`, `hideChatHistoryButton`, `hideNewChatButton`
|
|
68
|
+
- **View slots:** `subtitleView(Group?, User?, ctx)`, `listItemView(Group?, User?, ctx)`, `trailingView(User?, Group?, ctx)`, `leadingStateView(Group?, User?, ctx)`, `titleView`, `auxiliaryButtonView`
|
|
69
|
+
- **Style:** `CometChatMessageHeaderStyle`
|
|
70
|
+
- **Implements:** `PreferredSizeWidget` (use as `appBar:` in Scaffold)
|
|
71
|
+
|
|
72
|
+
### CometChatUsers
|
|
73
|
+
|
|
74
|
+
Displays a searchable, alphabetically sorted list of users.
|
|
75
|
+
|
|
76
|
+
- **Location:** `chat_ui/src/users/cometchat_users.dart`
|
|
77
|
+
- **Key props:** `onItemTap`, `onItemLongPress`, `usersRequestBuilder`, `usersStatusVisibility`, `hideSearch`, `selectionMode`, `usersBloc`
|
|
78
|
+
- **View slots:** `listItemView(User)`, `subtitleView(ctx, User)`, `trailingView(ctx, User)`, `leadingView(ctx, User)`, `titleView(ctx, User)`, `emptyStateView`, `errorStateView`, `loadingStateView`
|
|
79
|
+
- **Style:** `CometChatUsersStyle`
|
|
80
|
+
- **Request builder:** `UsersRequestBuilder`
|
|
81
|
+
|
|
82
|
+
### CometChatGroups
|
|
83
|
+
|
|
84
|
+
Displays a searchable list of groups the user has joined or can join.
|
|
85
|
+
|
|
86
|
+
- **Location:** `chat_ui/src/groups/cometchat_groups.dart`
|
|
87
|
+
- **Key props:** `onItemTap`, `onItemLongPress`, `groupsRequestBuilder`, `hideSearch`, `selectionMode`, `groupTypeVisibility`, `groupsBloc`
|
|
88
|
+
- **View slots:** `listItemView(Group)`, `subtitleView(ctx, Group)`, `trailingView(ctx, Group)`, `leadingView(ctx, Group)`, `titleView(ctx, Group)`, `emptyStateView`, `errorStateView`, `loadingStateView`
|
|
89
|
+
- **Style:** `CometChatGroupsStyle`
|
|
90
|
+
- **Request builder:** `GroupsRequestBuilder`
|
|
91
|
+
|
|
92
|
+
### CometChatGroupMembers
|
|
93
|
+
|
|
94
|
+
Displays members of a specific group with role badges and management options (kick, ban, scope change).
|
|
95
|
+
|
|
96
|
+
- **Location:** `chat_ui/src/group_members/cometchat_group_members.dart`
|
|
97
|
+
- **Key props:** `group` (required), `groupMembersRequestBuilder`, `hideSearch`, `selectionMode`, `usersStatusVisibility`, `hideBanMemberOption`, `hideKickMemberOption`, `hideScopeChangeOption`
|
|
98
|
+
- **View slots:** `listItemView(GroupMember)`, `subtitleView(ctx, GroupMember)`, `trailingView(ctx, GroupMember)`, `leadingView`, `titleView`, `emptyStateView`, `errorStateView`, `loadingStateView`
|
|
99
|
+
- **Style:** `CometChatGroupMembersStyle`
|
|
100
|
+
- **Request builder:** `GroupMembersRequestBuilder`
|
|
101
|
+
|
|
102
|
+
### CometChatSearch
|
|
103
|
+
|
|
104
|
+
Full-screen search across conversations and messages with filter chips and dual-section results.
|
|
105
|
+
|
|
106
|
+
- **Location:** `chat_ui/src/search/cometchat_search.dart`
|
|
107
|
+
- **Key props:** `onConversationClicked`, `onMessageClicked`, `searchFilters`, `searchIn`, `user`, `group`, `conversationsRequestBuilder`, `messagesRequestBuilder`
|
|
108
|
+
- **View slots:** `conversationItemView(ctx, Conversation)`, `conversationSubtitleView(ctx, Conversation)`, `conversationLeadingView(ctx, Conversation)`, `conversationTailView(ctx, Conversation)`, `searchTextMessageView(ctx, TextMessage)`, `searchImageMessageView(ctx, MediaMessage)`, `emptyStateView`, `errorStateView`, `loadingStateView`, `initialStateView`
|
|
109
|
+
- **Style:** `CometChatSearchStyle`
|
|
110
|
+
|
|
111
|
+
### CometChatThreadedHeader
|
|
112
|
+
|
|
113
|
+
Displays a parent message with reply count in a threaded conversation view. Listens for real-time reply count updates.
|
|
114
|
+
|
|
115
|
+
- **Location:** `chat_ui/src/threaded_header/widgets/cometchat_threaded_header.dart`
|
|
116
|
+
- **Key props:** `parentMessage` (required), `loggedInUser` (required), `template`, `receiptsVisibility`, `textFormatters`
|
|
117
|
+
- **View slots:** `messageActionView(BaseMessage, ctx)`
|
|
118
|
+
- **Style:** `CometChatThreadedHeaderStyle`
|
|
119
|
+
|
|
120
|
+
### CometChatMessageInformation
|
|
121
|
+
|
|
122
|
+
Displays read/delivered receipt information for a message. Shows per-member receipts in group conversations.
|
|
123
|
+
|
|
124
|
+
- **Location:** `chat_ui/src/message_information/widgets/cometchat_message_information.dart`
|
|
125
|
+
- **Key props:** `message` (required), `title`, `template`, `textFormatters`
|
|
126
|
+
- **Style:** `CometChatMessageInformationStyle`
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 2. Call Components
|
|
131
|
+
|
|
132
|
+
### CometChatCallButtons
|
|
133
|
+
|
|
134
|
+
Voice and video call icon buttons. Supports direct calls (user) and meetings (group).
|
|
135
|
+
|
|
136
|
+
- **Location:** `call_ui/src/call_buttons/cometchat_call_buttons.dart`
|
|
137
|
+
- **Key props:** `user`, `group`, `hideVoiceCallButton`, `hideVideoCallButton`, `outgoingCallConfiguration`, `callSettingsBuilder`, `callButtonsBloc`
|
|
138
|
+
- **View slots:** `voiceCallIcon`, `videoCallIcon`
|
|
139
|
+
- **Style:** `CometChatCallButtonsStyle`
|
|
140
|
+
|
|
141
|
+
### CometChatIncomingCall
|
|
142
|
+
|
|
143
|
+
Full-screen incoming call UI with accept/decline buttons. Shown when the logged-in user receives a call.
|
|
144
|
+
|
|
145
|
+
- **Location:** `call_ui/src/incoming_call/cometchat_incoming_call.dart`
|
|
146
|
+
- **Key props:** `call` (required), `user`, `callSettingsBuilder`, `onDecline`, `onAccept`, `disableSoundForCalls`, `customSoundForCalls`
|
|
147
|
+
- **View slots:** `titleView(ctx, Call)`, `subTitleView(ctx, Call)`, `leadingView(ctx, Call)`, `trailingView(ctx, Call)`, `itemView(ctx, Call)`
|
|
148
|
+
- **Style:** `CometChatIncomingCallStyle`
|
|
149
|
+
|
|
150
|
+
### CometChatOutgoingCall
|
|
151
|
+
|
|
152
|
+
Full-screen outgoing call UI with cancel button. Shown when the logged-in user initiates a call.
|
|
153
|
+
|
|
154
|
+
- **Location:** `call_ui/src/outgoing_call/cometchat_outgoing_call.dart`
|
|
155
|
+
- **Key props:** `call` (required), `user`, `sessionSettingsBuilder`, `onCancelled`, `disableSoundForCalls`, `customSoundForCalls`
|
|
156
|
+
- **View slots:** `subtitleView(ctx, Call)`, `avatarView(ctx, Call)`, `titleView(ctx, Call)`, `cancelledView(ctx, Call)`
|
|
157
|
+
- **Style:** `CometChatOutgoingCallStyle`
|
|
158
|
+
|
|
159
|
+
### CometChatOngoingCall
|
|
160
|
+
|
|
161
|
+
Renders the active call screen using the CometChat Calls SDK. Blocks back navigation.
|
|
162
|
+
|
|
163
|
+
- **Location:** `call_ui/src/ongoing_call/cometchat_ongoing_call.dart`
|
|
164
|
+
- **Key props:** `sessionSettingsBuilder` (required), `sessionId` (required), `callWorkFlow`, `onError`, `bloc`
|
|
165
|
+
- **Style:** None (rendered by Calls SDK)
|
|
166
|
+
|
|
167
|
+
### CometChatCallLogs
|
|
168
|
+
|
|
169
|
+
Displays a list of call logs (missed, incoming, outgoing) with icons and timestamps.
|
|
170
|
+
|
|
171
|
+
- **Location:** `call_ui/src/call_logs/cometchat_call_logs/cometchat_call_logs.dart`
|
|
172
|
+
- **Key props:** `callLogsRequestBuilder`, `onItemClick`, `onCallLogIconClicked`, `hideAppbar`, `outgoingCallConfiguration`, `callLogsBloc`
|
|
173
|
+
- **View slots:** `listItemView(CallLog, ctx)`, `subTitleView(CallLog, ctx)`, `trailingView`, `leadingStateView`, `titleView`, `emptyStateView`, `errorStateView`, `loadingStateView`
|
|
174
|
+
- **Style:** `CometChatCallLogsStyle`
|
|
175
|
+
- **Request builder:** `CallLogRequestBuilder`
|
|
176
|
+
|
|
177
|
+
### CometChatCallBubble
|
|
178
|
+
|
|
179
|
+
Inline bubble for call messages inside the message list. Shows call type icon, title, and join button.
|
|
180
|
+
|
|
181
|
+
- **Location:** `call_ui/src/call_bubble/cometchat_call_bubble.dart`
|
|
182
|
+
- **Key props:** `icon`, `title`, `buttonText`, `onTap`, `subtitle`, `alignment`, `iconUrl`
|
|
183
|
+
- **Style:** `CometChatCallBubbleStyle`
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 3. Shared Views
|
|
188
|
+
|
|
189
|
+
### CometChatAvatar
|
|
190
|
+
|
|
191
|
+
Circular avatar with image URL fallback to initials from name.
|
|
192
|
+
|
|
193
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/avatar/cometchat_avatar.dart`
|
|
194
|
+
- **Key props:** `image`, `name`, `width`, `height`, `padding`, `margin`, `colorPalette`, `spacing`, `typography`
|
|
195
|
+
- **Style:** `CometChatAvatarStyle`
|
|
196
|
+
|
|
197
|
+
### CometChatBadge
|
|
198
|
+
|
|
199
|
+
Unread count badge (red circle with number).
|
|
200
|
+
|
|
201
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/badge/cometchat_badge.dart`
|
|
202
|
+
- **Style:** `CometChatBadgeStyle`
|
|
203
|
+
|
|
204
|
+
### CometChatReceipt
|
|
205
|
+
|
|
206
|
+
Message delivery receipt icons (sent, delivered, read).
|
|
207
|
+
|
|
208
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/receipt/cometchat_receipt.dart`
|
|
209
|
+
- **Style:** `CometChatReceiptStyle`
|
|
210
|
+
|
|
211
|
+
### CometChatReactions
|
|
212
|
+
|
|
213
|
+
Displays emoji reaction chips below a message bubble with tap/long-press callbacks.
|
|
214
|
+
|
|
215
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/components/reactions/cometchat_reactions.dart`
|
|
216
|
+
- **Key props:** `reactionList` (required), `alignment`, `onReactionTap`, `onReactionLongPress`, `colorPalette`, `spacing`, `typography`
|
|
217
|
+
- **Style:** `CometChatReactionsStyle`
|
|
218
|
+
|
|
219
|
+
### CometChatMessageBubble
|
|
220
|
+
|
|
221
|
+
Skeleton structure for any message bubble. Binds together leading, header, content, footer, thread, reply, and bottom views.
|
|
222
|
+
|
|
223
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/message_bubble/cometchat_message_bubble.dart`
|
|
224
|
+
- **Key props:** `alignment`, `colorPalette`, `spacing`, `contentPadding`
|
|
225
|
+
- **View slots:** `leadingView`, `headerView`, `contentView`, `footerView`, `bottomView`, `threadView`, `replyView`, `statusInfoView`
|
|
226
|
+
- **Style:** `CometChatMessageBubbleStyle`
|
|
227
|
+
|
|
228
|
+
### CometChatListBase
|
|
229
|
+
|
|
230
|
+
Top-level container with app bar, search box, and scrollable content. Used internally by Conversations, Users, Groups, GroupMembers.
|
|
231
|
+
|
|
232
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/components/list_base/cometchat_listbase.dart`
|
|
233
|
+
- **Key props:** `container` (required), `title`, `hideSearch`, `showBackButton`, `onSearch`, `hideAppBar`, `searchReadOnly`, `onSearchTap`
|
|
234
|
+
- **View slots:** `backIcon`, `menuOptions`, `titleView`
|
|
235
|
+
- **Style:** `ListBaseStyle`
|
|
236
|
+
|
|
237
|
+
### CometChatStatusIndicator
|
|
238
|
+
|
|
239
|
+
Small colored dot indicating user online/offline status or group type icon.
|
|
240
|
+
|
|
241
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/status_indicator/cometchat_status_indicator.dart`
|
|
242
|
+
- **Style:** `CometChatStatusIndicatorStyle`
|
|
243
|
+
|
|
244
|
+
### CometChatDate
|
|
245
|
+
|
|
246
|
+
Formatted date/time label used in conversation trailing, message date separators, and sticky headers.
|
|
247
|
+
|
|
248
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/date/cometchat_date.dart`
|
|
249
|
+
- **Style:** `CometChatDateStyle`
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 4. Bubble Widgets
|
|
254
|
+
|
|
255
|
+
Content widgets rendered inside `CometChatMessageBubble`. All accept optional `colorPalette`, `spacing`, `typography` for theme-caching optimization.
|
|
256
|
+
|
|
257
|
+
### CometChatTextBubble
|
|
258
|
+
|
|
259
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/text_bubble/cometchat_text_bubble.dart`
|
|
260
|
+
- **Key props:** `text`, `alignment`, `formatters`, `emojiCount`, `colorPalette`, `spacing`, `typography`
|
|
261
|
+
- **Style:** `CometChatTextBubbleStyle`
|
|
262
|
+
|
|
263
|
+
### CometChatImageBubble
|
|
264
|
+
|
|
265
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/image_bubble/cometchat_image_bubble.dart`
|
|
266
|
+
- **Key props:** `imageUrl`, `caption`, `colorPalette`, `spacing`
|
|
267
|
+
- **Style:** `CometChatImageBubbleStyle`
|
|
268
|
+
|
|
269
|
+
### CometChatVideoBubble
|
|
270
|
+
|
|
271
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/video_bubble/cometchat_video_bubble.dart`
|
|
272
|
+
- **Key props:** `videoUrl`, `thumbnailUrl`, `colorPalette`, `spacing`
|
|
273
|
+
- **Style:** `CometChatVideoBubbleStyle`
|
|
274
|
+
|
|
275
|
+
### CometChatAudioBubble
|
|
276
|
+
|
|
277
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/audio_bubble/cometchat_audio_bubble.dart`
|
|
278
|
+
- **Key props:** `audioUrl`, `title`, `colorPalette`, `spacing`, `typography`
|
|
279
|
+
- **Style:** `CometChatAudioBubbleStyle`
|
|
280
|
+
|
|
281
|
+
### CometChatFileBubble
|
|
282
|
+
|
|
283
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/file_bubble/cometchat_file_bubble.dart`
|
|
284
|
+
- **Key props:** `fileUrl`, `title`, `subtitle`, `colorPalette`, `spacing`, `typography`
|
|
285
|
+
- **Style:** `CometChatFileBubbleStyle`
|
|
286
|
+
|
|
287
|
+
### CometChatDeletedBubble
|
|
288
|
+
|
|
289
|
+
Placeholder shown for deleted messages ("This message was deleted").
|
|
290
|
+
|
|
291
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/deleted_bubble/cometchat_deleted_bubble.dart`
|
|
292
|
+
- **Style:** `CometChatDeletedBubbleStyle`
|
|
293
|
+
|
|
294
|
+
### CometChatCardBubble
|
|
295
|
+
|
|
296
|
+
Interactive card message with title, body, and action buttons.
|
|
297
|
+
|
|
298
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/bubbles/card_bubble/cometchat_card_bubble.dart`
|
|
299
|
+
- **Style:** `CardBubbleStyle`
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 5. Utility Widgets
|
|
304
|
+
|
|
305
|
+
### CometChatListItem
|
|
306
|
+
|
|
307
|
+
Individual row used inside list components. Combines avatar, status indicator, title, subtitle, and tail view.
|
|
308
|
+
|
|
309
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/list_item/cometchat_list_item.dart`
|
|
310
|
+
- **Key props:** `avatarURL`, `avatarName`, `statusIndicatorColor`, `statusIndicatorIcon`, `title`, `hideSeparator`
|
|
311
|
+
- **View slots:** `subtitleView`, `tailView`, `titleView`, `leadingStateView`
|
|
312
|
+
- **Style:** `ListItemStyle`, `CometChatAvatarStyle`, `CometChatStatusIndicatorStyle`
|
|
313
|
+
|
|
314
|
+
### CometChatConfirmDialog
|
|
315
|
+
|
|
316
|
+
Modal confirmation dialog with title, message, confirm/cancel buttons. Call `.show()` to display.
|
|
317
|
+
|
|
318
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/confirm_dialog/cometchat_confirm_dialog.dart`
|
|
319
|
+
- **Key props:** `context` (required), `title`, `messageText`, `confirmButtonText`, `cancelButtonText`, `onConfirm`, `onCancel`
|
|
320
|
+
- **Style:** `CometChatConfirmDialogStyle`
|
|
321
|
+
|
|
322
|
+
### CometChatActionSheet
|
|
323
|
+
|
|
324
|
+
Bottom sheet for message actions (copy, reply, delete, etc.) and attachment options.
|
|
325
|
+
|
|
326
|
+
- **Location:** `shared_ui/src/clean_architecture/presentation/views/misc/action_sheet/cometchat_action_sheet.dart`
|
|
327
|
+
- **Style:** `CometChatMessageOptionSheetStyle`, `CometChatAttachmentOptionSheetStyle`
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 6. AI Views
|
|
332
|
+
|
|
333
|
+
AI widget availability is in flux during the V6 beta cycle. As of `6.0.0-beta2`, the AI assistant chat history (`CometChatAIAssistantChatHistory`) and conversation summary (`CometChatAIConversationSummary`) views are exported via the chat barrel. Other AI widgets (`CometChatAISmartReplies`, `CometChatAIConversationStarter`, `CometChatAIAssistantBubble`) may or may not be exported depending on the beta — if your import errors with "undefined name", the symbol isn't in that beta. Verify against your installed version before relying on a specific class.
|
|
334
|
+
|
|
335
|
+
For AI behavior more broadly, the kit surfaces AI replies / summaries / starters inside the existing message list and composer when the matching dashboard extensions are enabled. Drive AI through extensions for the most stable path.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Quick Reference: Import
|
|
340
|
+
|
|
341
|
+
```dart
|
|
342
|
+
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart'; // All chat widgets
|
|
343
|
+
import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart'; // Call widgets
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Quick Reference: Architecture
|
|
347
|
+
|
|
348
|
+
All components follow Clean Architecture + BLoC:
|
|
349
|
+
```
|
|
350
|
+
{component}/
|
|
351
|
+
├── bloc/ # BLoC, Events, State (Equatable)
|
|
352
|
+
├── domain/ # Use Cases, Repository interfaces
|
|
353
|
+
├── data/ # Repository impl, DataSources
|
|
354
|
+
├── di/ # ServiceLocator (singleton)
|
|
355
|
+
└── widgets/ # UI components
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Quick Reference: Theme
|
|
359
|
+
|
|
360
|
+
Always use `CometChatThemeHelper` — never hardcode colors:
|
|
361
|
+
```dart
|
|
362
|
+
final colorPalette = CometChatThemeHelper.getColorPalette(context);
|
|
363
|
+
final typography = CometChatThemeHelper.getTypography(context);
|
|
364
|
+
final spacing = CometChatThemeHelper.getSpacing(context);
|
|
365
|
+
```
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-flutter-v6-conversations
|
|
3
|
+
description: >
|
|
4
|
+
Use when implementing the conversations list with CometChat Flutter UIKit v6.
|
|
5
|
+
Triggers on mentions of CometChatConversations, ConversationsBloc, ConversationsState,
|
|
6
|
+
ConversationsLoaded, ConversationsServiceLocator, conversation list, recent chats,
|
|
7
|
+
unread count, typing indicator in conversations, conversation item, last message,
|
|
8
|
+
delete conversation, swipe actions, ConversationsRequestBuilder, onItemTap,
|
|
9
|
+
subtitleView, trailingView, listItemView, or customizing the conversations screen.
|
|
10
|
+
Also use when the user asks about showing a list of chats or recent conversations.
|
|
11
|
+
license: "MIT"
|
|
12
|
+
compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
|
|
13
|
+
allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
|
|
14
|
+
metadata:
|
|
15
|
+
author: "CometChat"
|
|
16
|
+
version: "3.0.0"
|
|
17
|
+
tags: "cometchat flutter conversations chat-list recent-chats bloc"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# CometChat Flutter UIKit — Conversations
|
|
21
|
+
|
|
22
|
+
The `CometChatConversations` widget displays a list of recent conversations with real-time updates.
|
|
23
|
+
|
|
24
|
+
## Basic Usage
|
|
25
|
+
|
|
26
|
+
```dart
|
|
27
|
+
CometChatConversations(
|
|
28
|
+
onItemTap: (conversation) {
|
|
29
|
+
final user = conversation.conversationWith is User
|
|
30
|
+
? conversation.conversationWith as User : null;
|
|
31
|
+
final group = conversation.conversationWith is Group
|
|
32
|
+
? conversation.conversationWith as Group : null;
|
|
33
|
+
Navigator.push(context, MaterialPageRoute(
|
|
34
|
+
builder: (_) => MessagesScreen(user: user, group: group),
|
|
35
|
+
));
|
|
36
|
+
},
|
|
37
|
+
)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
conversations/
|
|
44
|
+
├── bloc/
|
|
45
|
+
│ ├── conversations_bloc.dart # SDK listeners, real-time updates, O(1) lookups
|
|
46
|
+
│ ├── conversations_event.dart # LoadConversations, DeleteConversation, etc.
|
|
47
|
+
│ └── conversations_state.dart # ConversationsInitial/Loading/Loaded/Empty/Error
|
|
48
|
+
├── domain/usecases/ # GetConversationsUseCase, DeleteConversationUseCase, etc.
|
|
49
|
+
├── data/ # Repository + DataSources (remote + local)
|
|
50
|
+
├── di/ # ConversationsServiceLocator (singleton)
|
|
51
|
+
└── widgets/ # List item, subtitle, trailing, empty/error/loading views
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## State Classes
|
|
55
|
+
|
|
56
|
+
```dart
|
|
57
|
+
ConversationsInitial // Before any data loaded
|
|
58
|
+
ConversationsLoading // Fetching initial list
|
|
59
|
+
ConversationsLoaded // Has data: conversations, hasMore, selectedConversations, isLoadingMore
|
|
60
|
+
ConversationsEmpty // No conversations exist
|
|
61
|
+
ConversationsError // Error with message + optional previousConversations
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`ConversationsLoaded` uses a monotonically increasing `_version` counter to guarantee unique emissions even when conversation IDs haven't changed (SDK's `Conversation.==` only compares `conversationId`).
|
|
65
|
+
|
|
66
|
+
## Key Events
|
|
67
|
+
|
|
68
|
+
| Event | Purpose |
|
|
69
|
+
|-------|---------|
|
|
70
|
+
| `LoadConversations({silent})` | Initial load. `silent: true` keeps existing list visible during refresh. |
|
|
71
|
+
| `LoadMoreConversations` | Pagination (scroll to bottom) |
|
|
72
|
+
| `DeleteConversation(id)` | Calls SDK to delete |
|
|
73
|
+
| `RemoveConversation(id)` | Remove from list without SDK call (e.g., after group kick) |
|
|
74
|
+
| `SetActiveConversation(id)` | Track which conversation is open |
|
|
75
|
+
| `UpdateConversation(id, conversation)` | Update a specific conversation's data |
|
|
76
|
+
| `ResetUnreadCount(id)` | Clear unread badge when user reads messages |
|
|
77
|
+
|
|
78
|
+
## Real-Time Features
|
|
79
|
+
|
|
80
|
+
The BLoC automatically registers SDK listeners for:
|
|
81
|
+
- New messages → updates last message + moves conversation to top
|
|
82
|
+
- Typing indicators → per-conversation `ValueNotifier<List<TypingIndicator>>`
|
|
83
|
+
- User presence → online/offline status
|
|
84
|
+
- Read/delivery receipts → receipt icons
|
|
85
|
+
- Group events → member join/leave/kick/ban
|
|
86
|
+
- Connection state → reconnect triggers silent refresh
|
|
87
|
+
|
|
88
|
+
### Typing Indicators (ValueNotifier Pattern)
|
|
89
|
+
|
|
90
|
+
```dart
|
|
91
|
+
// In your custom list item, use ValueListenableBuilder for isolated rebuilds:
|
|
92
|
+
ValueListenableBuilder<List<TypingIndicator>>(
|
|
93
|
+
valueListenable: conversationsBloc.getTypingNotifier(conversation.conversationId!),
|
|
94
|
+
builder: (context, typingList, child) {
|
|
95
|
+
if (typingList.isEmpty) return _buildLastMessage();
|
|
96
|
+
return Text('${typingList.first.sender?.name} is typing...');
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Customization — View Slots
|
|
102
|
+
|
|
103
|
+
```dart
|
|
104
|
+
CometChatConversations(
|
|
105
|
+
// Replace entire list item
|
|
106
|
+
listItemView: (conversation) => MyCustomListItem(conversation),
|
|
107
|
+
|
|
108
|
+
// Replace just the subtitle — two-arg builder (BuildContext, Conversation)
|
|
109
|
+
subtitleView: (context, conversation) => Text(conversation.lastMessage?.text ?? ''),
|
|
110
|
+
|
|
111
|
+
// Replace trailing (time + badge) — SINGLE-arg builder. Note the asymmetry:
|
|
112
|
+
// subtitleView/leadingView/titleView take (BuildContext, Conversation),
|
|
113
|
+
// but trailingView takes just (Conversation).
|
|
114
|
+
trailingView: (conversation) => MyTrailingWidget(conversation),
|
|
115
|
+
|
|
116
|
+
// Style overrides
|
|
117
|
+
conversationsStyle: CometChatConversationsStyle(
|
|
118
|
+
backgroundColor: colors.background1,
|
|
119
|
+
titleStyle: typography.heading3?.bold,
|
|
120
|
+
),
|
|
121
|
+
|
|
122
|
+
// Configuration
|
|
123
|
+
usersStatusVisibility: true,
|
|
124
|
+
receiptsVisibility: true,
|
|
125
|
+
deleteConversationOptionVisibility: true,
|
|
126
|
+
hideAppbar: false,
|
|
127
|
+
showBackButton: false,
|
|
128
|
+
|
|
129
|
+
// Text formatters for subtitle preview
|
|
130
|
+
textFormatters: [
|
|
131
|
+
CometChatMentionsFormatter(),
|
|
132
|
+
MarkdownTextFormatter(),
|
|
133
|
+
],
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Custom ConversationsRequest
|
|
138
|
+
|
|
139
|
+
```dart
|
|
140
|
+
CometChatConversations(
|
|
141
|
+
conversationsRequestBuilder: ConversationsRequestBuilder()
|
|
142
|
+
..limit = 30
|
|
143
|
+
..conversationType = 'user' // Only 1:1 chats
|
|
144
|
+
..withTags = true
|
|
145
|
+
..tags = ['important'],
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Gotchas
|
|
150
|
+
|
|
151
|
+
- `ConversationsLoaded` uses a `_version` counter because SDK's `Conversation.==` only compares `conversationId`. Without it, BLoC considers two lists with same IDs as equal even when `lastMessage` or `unreadMessageCount` changed, and skips the emission.
|
|
152
|
+
- The BLoC uses `_conversationIndexMap` for O(1) lookups. If you maintain your own list outside the BLoC, keep a parallel Map for performance.
|
|
153
|
+
- `silent: true` on `LoadConversations` keeps the existing list visible during refresh — use this for background→foreground and reconnect scenarios, not initial load.
|
|
154
|
+
- Typing indicators use `ValueNotifier` per conversation, NOT BLoC state. This prevents the entire list from rebuilding when one person types.
|
|
155
|
+
|
|
156
|
+
## Anti-Patterns
|
|
157
|
+
|
|
158
|
+
```dart
|
|
159
|
+
// ❌ WRONG — navigating with raw conversation object
|
|
160
|
+
onItemTap: (conv) => Navigator.push(context, MaterialPageRoute(
|
|
161
|
+
builder: (_) => MessagesScreen(conversation: conv), // MessagesScreen expects user OR group
|
|
162
|
+
))
|
|
163
|
+
|
|
164
|
+
// ✅ CORRECT — extract user/group from conversation
|
|
165
|
+
onItemTap: (conv) {
|
|
166
|
+
final user = conv.conversationWith is User ? conv.conversationWith as User : null;
|
|
167
|
+
final group = conv.conversationWith is Group ? conv.conversationWith as Group : null;
|
|
168
|
+
Navigator.push(context, MaterialPageRoute(
|
|
169
|
+
builder: (_) => MessagesScreen(user: user, group: group),
|
|
170
|
+
));
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```dart
|
|
175
|
+
// ❌ WRONG — creating BLoC without initializing ServiceLocator
|
|
176
|
+
final bloc = ConversationsBloc(/* ... */);
|
|
177
|
+
|
|
178
|
+
// ✅ CORRECT — setup first (widget does this automatically)
|
|
179
|
+
ConversationsServiceLocator.instance.setup();
|
|
180
|
+
final bloc = ConversationsBloc(
|
|
181
|
+
getLoggedInUserUseCase: ConversationsServiceLocator.instance.getLoggedInUserUseCase,
|
|
182
|
+
getConversationUseCase: ConversationsServiceLocator.instance.getConversationUseCase,
|
|
183
|
+
markAsDeliveredUseCase: ConversationsServiceLocator.instance.markAsDeliveredUseCase,
|
|
184
|
+
deleteConversationUseCase: ConversationsServiceLocator.instance.deleteConversationUseCase,
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```dart
|
|
189
|
+
// ❌ WRONG — rebuilding entire list for typing indicator
|
|
190
|
+
BlocBuilder<ConversationsBloc, ConversationsState>(
|
|
191
|
+
builder: (context, state) {
|
|
192
|
+
// This rebuilds ALL items when ANY state changes
|
|
193
|
+
},
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
// ✅ CORRECT — use ValueListenableBuilder per item
|
|
197
|
+
ValueListenableBuilder<List<TypingIndicator>>(
|
|
198
|
+
valueListenable: bloc.getTypingNotifier(conversationId),
|
|
199
|
+
builder: (_, typingList, __) { /* Only this item rebuilds */ },
|
|
200
|
+
)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Checklist
|
|
204
|
+
|
|
205
|
+
- [ ] `onItemTap` extracts `User`/`Group` from `conversation.conversationWith`
|
|
206
|
+
- [ ] `subscriptionType` set in UIKitSettings (required for real-time updates)
|
|
207
|
+
- [ ] Typing indicators use `ValueListenableBuilder`, not BLoC state
|
|
208
|
+
- [ ] Custom list items use `CometChatThemeHelper` for colors
|
|
209
|
+
- [ ] Text formatters passed if using mentions or markdown in subtitle preview
|
|
210
|
+
- [ ] `deleteConversationOptionVisibility` set based on app requirements
|