@cometchat/skills 4.2.1 → 4.4.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.
Files changed (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -12
  3. package/bin/install.js +59 -4
  4. package/package.json +14 -1
  5. package/skills/cometchat/SKILL.md +460 -77
  6. package/skills/cometchat/references/asking-questions.md +48 -0
  7. package/skills/cometchat-a11y/SKILL.md +3 -2
  8. package/skills/cometchat-android-v5/SKILL.md +2 -1
  9. package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
  10. package/skills/cometchat-android-v5-calls/references/README.md +1 -1
  11. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
  12. package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
  13. package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
  14. package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
  15. package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
  16. package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
  19. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
  20. package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
  21. package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
  22. package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
  23. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
  24. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
  25. package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
  26. package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
  27. package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
  28. package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
  29. package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
  30. package/skills/cometchat-android-v5-components/SKILL.md +4 -3
  31. package/skills/cometchat-android-v5-core/SKILL.md +20 -2
  32. package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
  33. package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
  34. package/skills/cometchat-android-v5-features/SKILL.md +5 -4
  35. package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
  36. package/skills/cometchat-android-v5-production/SKILL.md +2 -1
  37. package/skills/cometchat-android-v5-push/SKILL.md +2 -3
  38. package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
  39. package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
  40. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
  41. package/skills/cometchat-android-v6/SKILL.md +2 -1
  42. package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
  43. package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
  44. package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
  45. package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
  46. package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
  47. package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
  48. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
  49. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
  50. package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
  51. package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
  52. package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
  53. package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
  54. package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
  55. package/skills/cometchat-android-v6-core/SKILL.md +389 -9
  56. package/skills/cometchat-android-v6-events/SKILL.md +4 -1
  57. package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
  58. package/skills/cometchat-android-v6-features/SKILL.md +26 -2
  59. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
  60. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
  61. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
  62. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
  63. package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
  64. package/skills/cometchat-android-v6-production/SKILL.md +6 -3
  65. package/skills/cometchat-android-v6-push/SKILL.md +43 -2
  66. package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
  67. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
  68. package/skills/cometchat-angular-calls/SKILL.md +256 -389
  69. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
  70. package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
  71. package/skills/cometchat-angular-calls/references/call-session.md +2 -2
  72. package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
  73. package/skills/cometchat-angular-calls/references/device-management.md +53 -34
  74. package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
  75. package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
  76. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
  77. package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
  78. package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
  79. package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
  80. package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
  81. package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
  82. package/skills/cometchat-angular-components/SKILL.md +149 -620
  83. package/skills/cometchat-angular-core/SKILL.md +235 -293
  84. package/skills/cometchat-angular-customization/SKILL.md +415 -223
  85. package/skills/cometchat-angular-features/SKILL.md +216 -334
  86. package/skills/cometchat-angular-patterns/SKILL.md +168 -359
  87. package/skills/cometchat-angular-placement/SKILL.md +189 -560
  88. package/skills/cometchat-angular-production/SKILL.md +241 -92
  89. package/skills/cometchat-angular-push/SKILL.md +280 -294
  90. package/skills/cometchat-angular-testing/SKILL.md +430 -158
  91. package/skills/cometchat-angular-theming/SKILL.md +190 -265
  92. package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
  93. package/skills/cometchat-astro-patterns/SKILL.md +22 -1
  94. package/skills/cometchat-calls/SKILL.md +25 -19
  95. package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
  96. package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
  97. package/skills/cometchat-calls/references/use-case-support.md +3 -4
  98. package/skills/cometchat-calls/references/use-case-team.md +23 -12
  99. package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
  100. package/skills/cometchat-components/SKILL.md +163 -25
  101. package/skills/cometchat-core/SKILL.md +412 -13
  102. package/skills/cometchat-customization/SKILL.md +50 -25
  103. package/skills/cometchat-features/SKILL.md +313 -34
  104. package/skills/cometchat-flutter-v5/SKILL.md +10 -4
  105. package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
  106. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
  107. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
  108. package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
  109. package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
  110. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
  111. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
  112. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
  113. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
  114. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
  115. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
  116. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
  117. package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
  118. package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
  119. package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
  120. package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
  121. package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
  122. package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
  123. package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
  124. package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
  125. package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
  126. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
  127. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
  128. package/skills/cometchat-flutter-v6/SKILL.md +17 -16
  129. package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
  130. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
  131. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
  132. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
  133. package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
  134. package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
  135. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
  136. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
  137. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
  138. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
  139. package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
  140. package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
  141. package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
  142. package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
  143. package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
  144. package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
  145. package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
  146. package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
  147. package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
  148. package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
  149. package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
  150. package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
  151. package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
  152. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
  153. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
  154. package/skills/cometchat-i18n/SKILL.md +139 -78
  155. package/skills/cometchat-ios/SKILL.md +4 -2
  156. package/skills/cometchat-ios-calls/SKILL.md +225 -95
  157. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
  158. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
  159. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
  160. package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
  161. package/skills/cometchat-ios-calls/references/call-session.md +51 -54
  162. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
  163. package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
  164. package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
  165. package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
  166. package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
  167. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
  168. package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
  169. package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
  170. package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
  171. package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
  172. package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
  173. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
  174. package/skills/cometchat-ios-components/SKILL.md +200 -12
  175. package/skills/cometchat-ios-core/SKILL.md +281 -11
  176. package/skills/cometchat-ios-customization/SKILL.md +276 -110
  177. package/skills/cometchat-ios-features/SKILL.md +64 -36
  178. package/skills/cometchat-ios-placement/SKILL.md +15 -12
  179. package/skills/cometchat-ios-production/SKILL.md +12 -4
  180. package/skills/cometchat-ios-push/SKILL.md +53 -19
  181. package/skills/cometchat-ios-testing/SKILL.md +14 -9
  182. package/skills/cometchat-ios-theming/SKILL.md +39 -3
  183. package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
  184. package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
  185. package/skills/cometchat-native-calls/SKILL.md +89 -19
  186. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
  187. package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
  188. package/skills/cometchat-native-calls/references/call-session.md +2 -2
  189. package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
  190. package/skills/cometchat-native-calls/references/device-management.md +53 -30
  191. package/skills/cometchat-native-calls/references/group-calls.md +35 -30
  192. package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
  193. package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
  194. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
  195. package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
  196. package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
  197. package/skills/cometchat-native-calls/references/share-invite.md +7 -5
  198. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
  199. package/skills/cometchat-native-components/SKILL.md +91 -57
  200. package/skills/cometchat-native-core/SKILL.md +281 -9
  201. package/skills/cometchat-native-customization/SKILL.md +150 -28
  202. package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
  203. package/skills/cometchat-native-features/SKILL.md +79 -49
  204. package/skills/cometchat-native-placement/SKILL.md +19 -10
  205. package/skills/cometchat-native-production/SKILL.md +9 -3
  206. package/skills/cometchat-native-push/SKILL.md +2 -1
  207. package/skills/cometchat-native-testing/SKILL.md +1 -2
  208. package/skills/cometchat-native-theming/SKILL.md +54 -29
  209. package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
  210. package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
  211. package/skills/cometchat-placement/SKILL.md +42 -3
  212. package/skills/cometchat-production/SKILL.md +12 -5
  213. package/skills/cometchat-react-calls/SKILL.md +220 -10
  214. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
  215. package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
  216. package/skills/cometchat-react-calls/references/call-session.md +1 -1
  217. package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
  218. package/skills/cometchat-react-calls/references/device-management.md +55 -51
  219. package/skills/cometchat-react-calls/references/group-calls.md +18 -23
  220. package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
  221. package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
  222. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
  223. package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
  224. package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
  225. package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
  226. package/skills/cometchat-react-calls/references/share-invite.md +4 -5
  227. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
  228. package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
  229. package/skills/cometchat-react-patterns/SKILL.md +57 -4
  230. package/skills/cometchat-react-push/SKILL.md +258 -72
  231. package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
  232. package/skills/cometchat-react-testing/SKILL.md +14 -5
  233. package/skills/cometchat-theming/SKILL.md +181 -18
  234. package/skills/cometchat-troubleshooting/SKILL.md +40 -20
@@ -6,14 +6,15 @@ description: >
6
6
  Use when the user wants custom bubbles, custom headers, custom list items, custom
7
7
  message actions, or custom message types.
8
8
  license: "MIT"
9
- compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
10
- allowed-tools: "shell, file-read, file-search, file-list, grep"
9
+ compatibility: "cometchat_chat_uikit ^6.0.1"
11
10
  metadata:
12
11
  author: "CometChat"
13
12
  version: "3.0.0"
14
13
  tags: "cometchat flutter customization bubbles templates formatters datasource"
15
14
  ---
16
15
 
16
+ > **Ground truth:** `cometchat_chat_uikit: ^6.0` — pub-cache source + `ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/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.
17
+
17
18
  # CometChat Flutter UIKit v6 — Customization Guide
18
19
 
19
20
  Four tiers of customization, from lightest to deepest.
@@ -41,8 +42,11 @@ CometChatConversations(
41
42
  listItemView: (Conversation conversation) => MyCustomConversationTile(conversation),
42
43
 
43
44
  // Replace individual slots
44
- subtitleView: (BuildContext context, Conversation conversation) =>
45
- Text(conversation.lastMessage?.text ?? ''),
45
+ subtitleView: (BuildContext context, Conversation conversation) {
46
+ final last = conversation.lastMessage;
47
+ final preview = last is TextMessage ? last.text : '';
48
+ return Text(preview);
49
+ },
46
50
  trailingView: (Conversation conversation) =>
47
51
  Icon(Icons.chevron_right),
48
52
  leadingView: (BuildContext context, Conversation conversation) =>
@@ -107,8 +111,8 @@ CometChatMessageHeader(
107
111
  CometChatMessageList(
108
112
  user: user,
109
113
  group: group,
110
- headerView: (context, state) => MyCustomListHeader(),
111
- footerView: (context, state) => MyCustomListFooter(),
114
+ headerView: (context, {user, group, parentMessageId}) => MyCustomListHeader(),
115
+ footerView: (context, {user, group, parentMessageId}) => MyCustomListFooter(),
112
116
  emptyStateView: (context) => Center(child: Text('Start a conversation')),
113
117
  emptyChatGreetingView: (context) => WelcomeWidget(),
114
118
  loadingStateView: (context) => ShimmerList(),
@@ -122,11 +126,11 @@ CometChatMessageList(
122
126
  CometChatMessageComposer(
123
127
  user: user,
124
128
  group: group,
125
- headerView: (context, state) => ReplyPreviewBanner(),
126
- footerView: (context, state) => SuggestedActionsBar(),
127
- auxiliaryButtonView: (context, user, group, composerState) =>
129
+ headerView: (context, user, group, id) => ReplyPreviewBanner(),
130
+ footerView: (context, user, group, id) => SuggestedActionsBar(),
131
+ auxiliaryButtonView: (context, user, group, id) =>
128
132
  IconButton(icon: Icon(Icons.gif), onPressed: () {}),
129
- secondaryButtonView: (context, user, group, composerState) =>
133
+ secondaryButtonView: (context, user, group, id) =>
130
134
  IconButton(icon: Icon(Icons.attach_file), onPressed: () {}),
131
135
  sendButtonView: Icon(Icons.send, color: Colors.blue),
132
136
  )
@@ -156,7 +160,7 @@ CometChatMessageList(
156
160
  messagesRequestBuilder: MessagesRequestBuilder()
157
161
  ..uid = user.uid
158
162
  ..limit = 50
159
- ..hideDeletedMessages = true
163
+ ..hideDeleted = true
160
164
  ..searchKeyword = 'invoice'
161
165
  ..categories = [MessageCategoryConstants.message]
162
166
  ..types = [MessageTypeConstants.text, MessageTypeConstants.image],
@@ -195,7 +199,7 @@ CometChatGroupMembers(
195
199
  group: group,
196
200
  groupMembersRequestBuilder: GroupMembersRequestBuilder(group.guid)
197
201
  ..limit = 30
198
- ..scopes = [GroupMemberScope.admin, GroupMemberScope.moderator],
202
+ ..scopes = [CometChatMemberScope.admin, CometChatMemberScope.moderator],
199
203
  )
200
204
  ```
201
205
 
@@ -271,10 +275,16 @@ class CometChatMessageTemplate {
271
275
  this.bottomView, // below contentView
272
276
  this.statusInfoView, // receipts/time area
273
277
  this.threadView, // thread reply indicator
274
- this.replyView, // quoted reply preview
278
+ this.replyView, // quoted-reply preview area (3-arg builder, NO additionalConfigurations)
275
279
  this.options, // long-press menu options
276
280
  });
277
281
  }
282
+
283
+ // `replyView` exists on BOTH CometChatMessageTemplate (template-level, signature
284
+ // `(BaseMessage, BuildContext, BubbleAlignment)`) AND on CometChatMessageBubble
285
+ // (the widget slot). Verified: only the clean_architecture template is exported
286
+ // (shared_ui/src/clean_architecture/data/models/cometchat_message_template.dart:79)
287
+ // — the legacy shared_ui/src/models/ copy without replyView is NOT exported.
278
288
  ```
279
289
 
280
290
  Override templates on `CometChatMessageList`:
@@ -327,6 +337,55 @@ CometChatMessageOption(
327
337
  )
328
338
  ```
329
339
 
340
+ ### Custom attachment options — the builder REPLACES, so spread the defaults
341
+
342
+ `CometChatMessageComposer.attachmentOptions` is a `ComposerActionsBuilder` — `List<CometChatMessageComposerAction> Function(BuildContext, User?, Group?, Map<String,dynamic>? id)`. **Whatever list you return becomes the entire menu**; there is no merge. To add one option while keeping photo/video/audio/file/poll, seed the list from `ComposerAttachmentUtils.getAttachmentOptions(...)`.
343
+
344
+ > ⚠️ **`ComposerAttachmentUtils` is NOT exported from the package barrel** (`cometchat_chat_uikit.dart`) — verified by `dart analyze` against published `cometchat_chat_uikit 6.0.1`. The normal `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';` does **not** expose it; you must add a **deep import** of the internal path:
345
+ > ```dart
346
+ > import 'package:cometchat_chat_uikit/chat_ui/src/message_composer/utils/composer_attachment_utils.dart';
347
+ > ```
348
+ > This is an internal (`src/`) path — it works on 6.0.1 but is not part of the public API contract, so it may move across patch versions. There is no public accessor for the default attachment list in V6; this deep import is the only way to seed the defaults.
349
+
350
+ ```dart
351
+ import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
352
+ import 'package:cometchat_chat_uikit/chat_ui/src/message_composer/utils/composer_attachment_utils.dart'; // ComposerAttachmentUtils (not barrel-exported)
353
+
354
+ CometChatMessageComposer(
355
+ attachmentOptions: (context, user, group, id) => [
356
+ ...ComposerAttachmentUtils.getAttachmentOptions(context, id, null), // defaults
357
+ CometChatMessageComposerAction(
358
+ id: 'location',
359
+ title: 'Send Location',
360
+ onItemClick: (ctx, u, g) { /* pick + send (below) */ },
361
+ ),
362
+ ],
363
+ )
364
+ ```
365
+
366
+ ```dart
367
+ // ❌ returns ONLY your option — every default attachment disappears
368
+ attachmentOptions: (context, user, group, id) => [locationAction],
369
+ ```
370
+
371
+ ### Sending a custom message — use the UIKit path, not the raw SDK
372
+
373
+ A `contentView`/`BubbleFactory` only renders the type; send the message with **`CometChatUIKit.sendCustomMessage(...)`**, not `CometChat.sendCustomMessage(...)`. The UIKit wrapper sets `muid` + sender and fires `ccMessageSent`, which makes the new bubble **append** to the open list. The raw SDK call skips those, giving a recipient error and a realtime bubble that **replaces** an existing one (no `muid` dedup).
374
+
375
+ ```dart
376
+ final message = CustomMessage(
377
+ receiverUid: user.uid,
378
+ receiverType: ReceiverTypeConstants.user, // or .group
379
+ type: 'location', // matches the template type
380
+ customData: {'lat': 19.07, 'lng': 72.87},
381
+ );
382
+ // ✅ kit path — sets muid + sender, emits ccMessageSent → list appends
383
+ await CometChatUIKit.sendCustomMessage(message);
384
+ // ❌ await CometChat.sendCustomMessage(message); // recipient error + realtime replace
385
+ ```
386
+
387
+ Verified (v6, `dart analyze` vs published 6.0.1): `ComposerAttachmentUtils.getAttachmentOptions(BuildContext, Map?, AdditionalConfigurations?)` (composer_attachment_utils.dart:254 — **NOT barrel-exported; requires the deep import above**), `CometChatUIKit.sendCustomMessage(CustomMessage)`, `CustomMessage(receiverUid:, receiverType:, type:, customData:)`, `CometChatMessageComposerAction(id:, title:, icon:, style:, onItemClick:(BuildContext,User?,Group?))` (cometchat_message_composer_action.dart:23), `CometChatMessageOption(id:, title:, icon:, onItemClick:(BaseMessage,CometChatMessageListControllerProtocol), messageOptionSheetStyle:)` (cometchat_message_option.dart:21), `CometChatMessageTemplate({required type, required category, bubbleView, headerView, contentView, footerView, bottomView, statusInfoView, threadView, replyView, options})` (clean_architecture/data/models/cometchat_message_template.dart:23), `CometChatMessageList(templates:, addTemplate:)` (chat_ui/.../message_list/widgets/cometchat_message_list.dart:46-47).
388
+
330
389
  ## 5. Tier 4: BubbleFactory & DataSource
331
390
 
332
391
  ### BubbleFactory
@@ -427,9 +486,7 @@ class LocationBubbleFactory extends BubbleFactory<CustomMessage> {
427
486
 
428
487
  Merge your custom factories with the defaults using `CometChatMessageTemplate.addTemplate` on the message list, or by providing a custom `templates` list that includes a `contentView` for your custom type.
429
488
 
430
- The `CometChatMessageBubble` widget supports two modes:
431
- - Smart mode: pass `message` and the factory registry resolves the content widget via `BubbleFactory.getFactoryKey(message)` → O(1) map lookup.
432
- - Manual mode: pass `contentView` directly — bypasses the factory.
489
+ `CometChatMessageBubble` is a pure slot widget it accepts pre-built `contentView`, `headerView`, `footerView`, `replyView`, `threadView`, `bottomView`, `statusInfoView`, and `leadingView` widgets. It does NOT resolve message types via a factory registry; factory resolution happens one layer up, inside `CometChatMessageList`, which picks the right template based on `category_type` and invokes that template's `contentView` builder.
433
490
 
434
491
  ```dart
435
492
  // Using addTemplate to register a custom type alongside defaults
@@ -450,17 +507,22 @@ CometChatMessageList(
450
507
 
451
508
  ### DataSource Pattern
452
509
 
510
+ > **V6 ≠ V5 here.** V6 has **no** `ChatConfigurator`, `DataSource`/`DataSourceDecorator`, `ExtensionsDataSource`, `CometChatUIKit.getDataSource()`, or `getAllMessageTemplates()` override-and-register flow — that GetX-era framework is **V5-only** (verified absent in the v6 clone). In V6 you merge custom templates with the widget-level `addTemplate:` prop and customize data fetching by supplying a custom BLoC. Don't carry the V5 decorator recipe over.
511
+
453
512
  Each component follows Clean Architecture with its own data source layer. The data sources abstract SDK calls behind interfaces:
454
513
 
455
514
  ```dart
456
- // Example: ConversationsRemoteDataSource
515
+ // Example: ConversationsRemoteDataSource (full real interface)
457
516
  abstract class ConversationsRemoteDataSource {
458
- Future<List<Conversation>> getConversations({ConversationsRequest? request});
459
- Future<void> deleteConversation(String conversationWith);
517
+ Future<List<Conversation>> getConversations({int limit = 30, String? fromId});
518
+ Future<Conversation?> getConversation(String conversationWith, String conversationType);
519
+ Future<void> deleteConversation(String conversationWith, String conversationType);
520
+ Future<void> markMessageAsRead(BaseMessage message);
521
+ Future<Conversation?> updateConversation(BaseMessage message);
460
522
  }
461
523
 
462
524
  class ConversationsRemoteDataSourceImpl implements ConversationsRemoteDataSource {
463
- // Delegates to CometChat SDK
525
+ // Delegates to CometChat SDK — must implement ALL five methods above.
464
526
  }
465
527
  ```
466
528
 
@@ -569,10 +631,12 @@ void didChangeDependencies() {
569
631
  }
570
632
  }
571
633
 
572
- // Pass to children
634
+ // Pass to children — CometChatMessageBubble exposes colorPalette + spacing only
573
635
  CometChatMessageBubble(
574
636
  colorPalette: _colorPalette, // pre-cached, zero lookups in child
575
637
  spacing: _spacing,
638
+ // For typography, read CometChatThemeHelper.getTypography(context) in the
639
+ // parent and use it directly inside the slot widgets you pass in.
576
640
  )
577
641
  ```
578
642
 
@@ -607,7 +671,7 @@ CometChatMessageList(
607
671
  CometChatMessageTemplate(
608
672
  type: MessageTypeConstants.text,
609
673
  category: MessageCategoryConstants.message,
610
- contentView: (msg, ctx, align, {additionalConfigurations}) => Text(msg.text),
674
+ contentView: (msg, ctx, align, {additionalConfigurations}) => Text(msg is TextMessage ? msg.text : ''),
611
675
  // options: null — no long-press menu at all!
612
676
  ),
613
677
  ],
@@ -634,15 +698,19 @@ return Container(color: colorPalette?.primary ?? Colors.blue);
634
698
  ```
635
699
 
636
700
  ```dart
637
- // WRONGforgetting resizeToAvoidBottomInset: false on Scaffold with composer
701
+ // CORRECT on ^6.0.1 true (or omit; true is the default). The composer
702
+ // clamps the keyboard height to viewInsets (kit fix ENG-34434), so true does
703
+ // NOT double-compensate.
638
704
  Scaffold(
705
+ resizeToAvoidBottomInset: true,
639
706
  body: Column(children: [
640
707
  Expanded(child: CometChatMessageList(user: user)),
641
708
  CometChatMessageComposer(user: user),
642
709
  ]),
643
710
  )
644
711
 
645
- // CORRECT
712
+ // PRE-6.0.1 ONLY — false was the stopgap before the clamp landed. On ^6.0.1
713
+ // this is unnecessary; if you still see a double keyboard gap, upgrade the kit.
646
714
  Scaffold(
647
715
  resizeToAvoidBottomInset: false,
648
716
  body: Column(children: [
@@ -660,7 +728,11 @@ Scaffold(
660
728
  - [ ] Custom `BubbleFactory.build()` uses the passed `colorPalette`/`typography`/`spacing` params, not hardcoded values
661
729
  - [ ] Style overrides use `merge()` pattern, not constructor replacement
662
730
  - [ ] Theme lookups cached in `didChangeDependencies()` with `_themeInitialized` flag
663
- - [ ] `Scaffold` containing `CometChatMessageComposer` has `resizeToAvoidBottomInset: false`
731
+ - [ ] `Scaffold` containing `CometChatMessageComposer` uses `resizeToAvoidBottomInset: true` (or omits it) on `^6.0.1` — composer clamps to `viewInsets` (ENG-34434); `false` is only the pre-6.0.1 stopgap
664
732
  - [ ] Custom `CometChatMessageOption.onItemClick` handles both `BaseMessage` and the controller protocol
665
733
  - [ ] Request builders set `limit` to a reasonable value (default 30–50)
666
734
  - [ ] Mutable `_user`/`_group` state copies passed to UIKit components, not `widget.user`/`widget.group`
735
+
736
+ ## Sound (in-app message + call sounds)
737
+
738
+ Sound is a customization sub-dimension. The UI Kit plays incoming/outgoing message + call sounds via `CometChatSoundManager` — mute it, swap custom audio, or play a specific sound. The full API + recipe lives in **`cometchat-flutter-v6-theming`** (Sound section). Verify the access path against the installed kit before relying on it.
@@ -12,14 +12,15 @@ description: >
12
12
  addMessageListener, removeMessageListener, ChatSDKEventInitializer,
13
13
  or any real-time update handling in CometChat.
14
14
  license: "MIT"
15
- compatibility: "cometchat_chat_uikit ^6.0.0-beta2; cometchat_sdk ^4.1.2"
16
- allowed-tools: "shell, file-read, file-search, file-list, grep"
15
+ compatibility: "cometchat_chat_uikit ^6.0.1; cometchat_sdk ^5.0.1"
17
16
  metadata:
18
17
  author: "CometChat"
19
18
  version: "3.0.0"
20
19
  tags: "cometchat flutter events listeners real-time typing receipts presence"
21
20
  ---
22
21
 
22
+ > **Ground truth:** `cometchat_chat_uikit: ^6.0` — pub-cache source + `ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/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.
23
+
23
24
  # CometChat Flutter UIKit — Events & Listeners
24
25
 
25
26
  Two event systems: SDK listeners (from CometChat server) and UI events (from UIKit components).
@@ -7,21 +7,27 @@ description: >
7
7
  what needs UIKitSettings flags, what's enabled by `cometchat apply-feature <id>`,
8
8
  and what needs manual dashboard configuration (third-party API keys).
9
9
  license: "MIT"
10
- compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
11
- allowed-tools: "shell, file-read, file-search, file-list, grep"
10
+ compatibility: "cometchat_chat_uikit ^6.0.1"
12
11
  metadata:
13
12
  author: "CometChat"
14
13
  version: "3.0.0"
15
14
  tags: "cometchat flutter features calls reactions stickers ai smart-replies extensions"
16
15
  ---
17
16
 
17
+ > **Ground truth:** `cometchat_chat_uikit: ^6.0` + `packages/registry/v6/features/catalog.json`. (Official docs linked below.) Verify symbols against the installed package/source before relying on them.
18
+
19
+ > **Also serves Flutter V5** for feature *enablement*: there is no separate `cometchat-flutter-v5-features`. The `apply-feature` CLI + 5-tier taxonomy here are identical for V5 (enablement is the SDK/dashboard path, version-independent). Only the in-UI wiring differs — for V5's GetX-based surfaces, follow `cometchat-flutter-v5-customization` / `-calls` for the widget side. V5 is legacy/maintenance-only.
20
+
18
21
  # CometChat Flutter UIKit v6 — Features
19
22
 
20
23
  How to enable, configure, and disable features in `cometchat_chat_uikit`.
21
24
 
22
25
  ## 1. Feature Categories
23
26
 
24
- Every feature falls into one of three categories:
27
+ > **Canonical public feature-availability matrix:** [Features & Extensions Guide](https://www.cometchat.com/docs/fundamentals/features-and-extensions-guide) — the authoritative source for which integration method (UI Kit / UI Kit Builder / Widget Builder / SDK) supports each feature + dashboard setup + whether code is required. It **outranks the local `catalog.json` snapshot on conflict**; consult it (WebFetch or docs MCP) for any availability decision.
28
+
29
+
30
+ Every feature falls into one of these categories (the product's "work needed" model — Core/zero-setup · Builder-enabled · Config-only · Config+settings · SDK-integrated). **Key rule:** the only category that needs **client code** is the SDK-integrated one (a few extensions like Bitly / message shortcuts) — and for those **the implementation lives in the docs** (fetch + adapt it, don't hand-roll). Everything in the table below except such SDK-integrated extensions is enable-and-done (no code):
25
31
 
26
32
  | Category | What it means | Example features | How to enable |
27
33
  |---|---|---|---|
@@ -29,7 +35,7 @@ Every feature falls into one of three categories:
29
35
  | **UIKitSettings flag** | Set a property on `UIKitSettingsBuilder` before `CometChatUIKit.init()` | Voice/video calls (`enableCalls: true`), presence/typing (`subscriptionType`) | Set the flag → init |
30
36
  | **Extension** | Backend extension, pure boolean toggle. CLI flips via the dashboard API. | Polls, stickers, message translation, link preview, collaborative document, collaborative whiteboard, image moderation, thumbnail generation | `cometchat apply-feature <id> --app-id <X>` → restart app |
31
37
  | **AI feature** | Backend AI feature requiring an OpenAI API key on the app's AI settings | Smart replies, conversation starters, conversation summary | `cometchat apply-feature <id> --app-id <X> --openai-key sk-...` → restart app |
32
- | **Dashboard-only** | Third-party API key / multi-field config the user must enter themselves | Giphy, Stipop, Tenor, Chatwoot, Intercom, Disappearing Messages, Message Shortcuts | Open https://app.cometchat.com → Extensions → enter config → enable |
38
+ | **Dashboard-only** | Third-party API key / multi-field config the user must enter themselves | Giphy, Stipop, Tenor, Chatwoot, Intercom, Disappearing Messages, Message Shortcuts | Open https://app.cometchat.com → Chat & Messaging Features → enter config → enable |
33
39
 
34
40
  ## 2. Auto-Enabled Features
35
41
 
@@ -107,7 +113,7 @@ cometchat apply-feature smart-replies --app-id <your-app-id> --openai-key sk-...
107
113
 
108
114
  Requires `cometchat auth login` once per machine. Once enabled, the UIKit auto-wires the UI.
109
115
 
110
- For dashboard-only extensions (Giphy, Stipop, Tenor, Chatwoot, Intercom — they need third-party API keys / webhooks), use https://app.cometchat.com → Extensions.
116
+ For dashboard-only extensions (Giphy, Stipop, Tenor, Chatwoot, Intercom — they need third-party API keys / webhooks), use https://app.cometchat.com → Chat & Messaging → Features.
111
117
 
112
118
  | Extension | UI surface when enabled | Extension directory |
113
119
  |---|---|---|
@@ -248,7 +254,10 @@ The composer's WYSIWYG toolbar is the active formatting system. Configure via:
248
254
  CometChatMessageComposer(
249
255
  user: user,
250
256
  group: group,
251
- richTextConfiguration: RichTextConfiguration(...),
257
+ // There is NO `richTextConfiguration` param. The real rich-text props are:
258
+ enableRichTextFormatting: true,
259
+ showRichTextFormattingOptions: true,
260
+ // hideRichTextFormattingOptions: <Set<FormatType>>, // optional
252
261
  richTextToolbarView: (context) => CustomToolbar(),
253
262
  onRichTextFormatApplied: (formatType) { },
254
263
  )
@@ -12,14 +12,15 @@ description: >
12
12
  smart replies, conversation starters, or resizeToAvoidBottomInset. Also use when
13
13
  the user asks about building a chat screen, message input, or message display.
14
14
  license: "MIT"
15
- compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
16
- allowed-tools: "shell, file-read, file-search, file-list, grep"
15
+ compatibility: "cometchat_chat_uikit ^6.0.1; flutter_bloc ^8.1.0"
17
16
  metadata:
18
17
  author: "CometChat"
19
18
  version: "3.0.0"
20
19
  tags: "cometchat flutter messages composer header bubbles keyboard rich-text"
21
20
  ---
22
21
 
22
+ > **Ground truth:** `cometchat_chat_uikit: ^6.0` — pub-cache source + `ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/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.
23
+
23
24
  # CometChat Flutter UIKit — Messages
24
25
 
25
26
  The messages screen is composed of three components: `CometChatMessageHeader`, `CometChatMessageList`, and `CometChatMessageComposer`.
@@ -27,38 +28,47 @@ The messages screen is composed of three components: `CometChatMessageHeader`, `
27
28
  ## Complete Messages Screen
28
29
 
29
30
  ```dart
31
+ final colorPalette = CometChatThemeHelper.getColorPalette(context);
30
32
  Scaffold(
31
- resizeToAvoidBottomInset: false, // REQUIRED composer handles keyboard internally
33
+ resizeToAvoidBottomInset: true, // matches sample app; composer clamps to viewInsets (ENG-34434)
32
34
  appBar: CometChatMessageHeader(
33
35
  user: user,
34
36
  group: group,
35
37
  onBack: () => Navigator.pop(context),
36
38
  ),
37
- body: Column(
38
- children: [
39
- Expanded(
40
- child: CometChatMessageList(
41
- user: user,
42
- group: group,
43
- textFormatters: [
44
- CometChatMentionsFormatter(user: user, group: group),
45
- MarkdownTextFormatter(),
46
- CometChatUrlFormatter(),
47
- CometChatPhoneNumberFormatter(),
48
- CometChatEmailFormatter(),
49
- ],
50
- ),
51
- ),
52
- CometChatMessageComposer(
53
- user: user,
54
- group: group,
55
- textFormatters: [
56
- CometChatMentionsFormatter(user: user, group: group),
57
- MarkdownTextFormatter(),
58
- CometChatUrlFormatter(),
39
+ body: SafeArea(
40
+ top: false, // Header is the appBar — top inset already handled; keep bottom inset
41
+ child: Container(
42
+ color: colorPalette.background3,
43
+ child: Column(
44
+ children: [
45
+ Expanded(
46
+ child: CometChatMessageList(
47
+ user: user,
48
+ group: group,
49
+ textFormatters: [
50
+ CometChatMentionsFormatter(user: user, group: group),
51
+ MarkdownTextFormatter(),
52
+ CometChatUrlFormatter(),
53
+ CometChatPhoneNumberFormatter(),
54
+ CometChatEmailFormatter(),
55
+ ],
56
+ ),
57
+ ),
58
+ CometChatMessageComposer(
59
+ user: user,
60
+ group: group,
61
+ textFormatters: [
62
+ CometChatMentionsFormatter(user: user, group: group),
63
+ MarkdownTextFormatter(),
64
+ CometChatUrlFormatter(),
65
+ CometChatPhoneNumberFormatter(),
66
+ CometChatEmailFormatter(),
67
+ ],
68
+ ),
59
69
  ],
60
70
  ),
61
- ],
71
+ ),
62
72
  ),
63
73
  )
64
74
  ```
@@ -81,6 +91,42 @@ Displays messages with `SliverAnimatedList`, O(1) lookups, and keyboard-aware sp
81
91
  | `hideDateSeparator` | `bool` | Hide date headers |
82
92
  | `textFormatters` | `List<CometChatTextFormatter>` | Formatters for message text |
83
93
  | `onThreadRepliesClick` | `Function(BaseMessage, BuildContext, {template})` | Thread navigation callback |
94
+ | `messagesRequestBuilder` | `MessagesRequestBuilder?` | Customize the underlying message query (see below) |
95
+
96
+ ### MessagesRequestBuilder — customizing the message query
97
+
98
+ `CometChatMessageList` accepts a `messagesRequestBuilder` prop that lets you customize the underlying SDK request — page size, filters, search, etc. The class lives in the Chat SDK (`package:cometchat_sdk/cometchat_sdk.dart`) and exposes 30+ fluent setters. Common setters:
99
+
100
+ | Setter | Purpose |
101
+ |--------|---------|
102
+ | `setLimit(int)` | Page size (default 30, max 100) |
103
+ | `setTypes(List<String>)` | Restrict to message types (e.g. `['text', 'image']`) |
104
+ | `setCategories(List<String>)` | Restrict to categories (e.g. `['message', 'custom']`) |
105
+ | `setHideMessagesFromBlockedUsers(bool)` | Drop messages from blocked users |
106
+ | `setSearchKeyword(String)` | Server-side keyword search |
107
+ | `setTags(List<String>)` | Filter by message tags |
108
+ | `setHasAttachments(bool)` | Only messages with file attachments |
109
+ | `setHasLinks(bool)` | Only messages containing links |
110
+ | `setHideReplies(bool)` | Exclude threaded replies from the main list |
111
+ | `setHideDeleted(bool)` | Exclude deleted messages |
112
+ | `setHideQuotedMessages(bool)` | Exclude quoted-reply messages |
113
+ | `setUpdatedAfter(DateTime)` | Only messages updated after this DateTime |
114
+ | `setUpdatesOnly(bool)` | Return only updates, not new messages |
115
+ | `setParentMessageId(int)` | Fetch a thread's replies |
116
+ | `setMentionedUIDs(List<String>)` | Messages mentioning specific users |
117
+ | `setHasMentions(bool)` | Only messages with any mention |
118
+
119
+ Example — limit to 30, hide messages from blocked users, restrict to text + image:
120
+
121
+ ```dart
122
+ CometChatMessageList(
123
+ user: user,
124
+ messagesRequestBuilder: MessagesRequestBuilder()
125
+ ..setLimit(30)
126
+ ..setHideMessagesFromBlockedUsers(true)
127
+ ..setTypes(['text', 'image']),
128
+ )
129
+ ```
84
130
 
85
131
  ### MessageListBloc Events
86
132
 
@@ -149,6 +195,8 @@ BlocConsumer<MessageComposerBloc, MessageComposerState>(
149
195
  )
150
196
  ```
151
197
 
198
+ The actual filter in `cometchat_message_composer.dart` also covers `editMessage` / `replyMessage` target changes and panel transitions (`headerPanel`, `footerPanel`, `previewPanel`, `lockedBottomPadding`, `isActiveStreaming`). The snippet above shows the three primary mode flags for brevity — if you subclass or wrap the composer, copy the full predicate from `cometchat_message_composer.dart` so edit/reply targets and panels also trigger rebuilds.
199
+
152
200
  ## CometChatMessageHeader
153
201
 
154
202
  Shows user/group info, typing indicators, and optional call buttons.
@@ -172,12 +220,14 @@ CometChatMessageHeader(
172
220
 
173
221
  ## Keyboard-Aware Spacing
174
222
 
175
- `SliverSpacing` handles keyboard interaction:
223
+ The composer coordinates with the keyboard internally — it tracks the native keyboard height and **clamps it to Flutter's `viewInsets`** (kit fix ENG-34434) so it does NOT add its own inset on top of the Scaffold's. The list's spacing then reacts to the same `viewInsets`:
176
224
  - At bottom: keyboard pushes list up (normal behavior)
177
225
  - Scrolled up: list stays still, only composer moves
178
226
  - Safe area: only added when keyboard is closed
179
227
 
180
- This is why `resizeToAvoidBottomInset: false` is mandatory.
228
+ Because of that clamp, **set `resizeToAvoidBottomInset: true`** (or omit it — `true` is the Scaffold default), which is exactly what the kit's official sample app does (`messages_screen.dart` omits it → defaults `true`; `thread_screen.dart` sets it `true` explicitly).
229
+
230
+ > Version note: on kits **before ENG-34434 (pre-6.0.1)** the composer did NOT clamp, so `true` double-compensated and `false` was the workaround. On `^6.0.1` (what this skill targets) `true` is correct. If you ever see a double keyboard gap, you're on an older kit — upgrade, or set `false` as a stopgap.
181
231
 
182
232
  ## Message Bubbles
183
233
 
@@ -230,24 +280,35 @@ await CometChatUIKit.sendCustomMessage(
230
280
  ```dart
231
281
  CometChatMessageList(
232
282
  onThreadRepliesClick: (message, ctx, {template}) {
283
+ final colorPalette = CometChatThemeHelper.getColorPalette(context);
233
284
  Navigator.push(context, MaterialPageRoute(
234
285
  builder: (_) => Scaffold(
235
- resizeToAvoidBottomInset: false,
236
- body: Column(
237
- children: [
238
- CometChatThreadedHeader(
239
- parentMessage: message,
240
- loggedInUser: CometChatUIKit.loggedInUser!,
241
- ),
242
- Expanded(child: CometChatMessageList(
243
- user: user, group: group,
244
- parentMessageId: message.id,
245
- )),
246
- CometChatMessageComposer(
247
- user: user, group: group,
248
- parentMessageId: message.id,
286
+ resizeToAvoidBottomInset: true,
287
+ body: SafeArea(
288
+ child: Container(
289
+ color: colorPalette.background3,
290
+ child: Column(
291
+ children: [
292
+ CometChatThreadedHeader(
293
+ parentMessage: message,
294
+ loggedInUser: CometChatUIKit.loggedInUser!,
295
+ ),
296
+ Expanded(child: CometChatMessageList(
297
+ user: user, group: group,
298
+ parentMessageId: message.id,
299
+ // Scope the list to this thread only: exclude the parent and
300
+ // request just the replies for message.id.
301
+ withParent: false,
302
+ messagesRequestBuilder: MessagesRequestBuilder()
303
+ ..parentMessageId = message.id,
304
+ )),
305
+ CometChatMessageComposer(
306
+ user: user, group: group,
307
+ parentMessageId: message.id,
308
+ ),
309
+ ],
249
310
  ),
250
- ],
311
+ ),
251
312
  ),
252
313
  ),
253
314
  ));
@@ -257,7 +318,7 @@ CometChatMessageList(
257
318
 
258
319
  ## Gotchas
259
320
 
260
- - Forgetting `resizeToAvoidBottomInset: false` causes double keyboard compensation the most common bug when integrating the messages screen. This applies to thread screens too any Scaffold containing a `CometChatMessageComposer` must set it to `false`.
321
+ - Use `resizeToAvoidBottomInset: true` (or omit it's the default), matching the kit sample app. On `^6.0.1` the composer clamps the keyboard height to Flutter's `viewInsets` (ENG-34434), so `true` does NOT double-compensate. Only on pre-6.0.1 kits did `true` cause a double keyboard gap (where `false` was the workaround) — if you see that gap, upgrade the kit.
261
322
  - `textFormatters` should be the same list for both `CometChatMessageList` and `CometChatMessageComposer` to ensure consistent rendering.
262
323
  - The rich text system has 3 implementations but only WYSIWYG is active at runtime. Bug fixes go in `rich_text_editing_controller.dart`, not the clean architecture module.
263
324
  - `goToMessageId` loads messages around that ID, not from the beginning. The list may not have older messages loaded.
@@ -272,27 +333,17 @@ CometChatMessageList(
272
333
  ## Anti-Patterns
273
334
 
274
335
  ```dart
275
- // ❌ WRONG — missing resizeToAvoidBottomInset
336
+ // ❌ WRONG — list not wrapped in Expanded (unbounded height → won't scroll / overflow)
276
337
  Scaffold(
277
338
  body: Column(children: [
278
- Expanded(child: CometChatMessageList(user: user)),
339
+ CometChatMessageList(user: user), // needs Expanded
279
340
  CometChatMessageComposer(user: user),
280
341
  ]),
281
342
  )
282
343
 
283
- // WRONG — thread screen with resizeToAvoidBottomInset: true
284
- Scaffold(
285
- resizeToAvoidBottomInset: true, // Double compensation!
286
- body: Column(children: [
287
- CometChatThreadedHeader(parentMessage: message, loggedInUser: user),
288
- Expanded(child: CometChatMessageList(user: user, parentMessageId: message.id)),
289
- CometChatMessageComposer(user: user, parentMessageId: message.id),
290
- ]),
291
- )
292
-
293
- // ✅ CORRECT — both messages and thread screens
344
+ // CORRECTboth messages and thread screens (matches the kit sample app)
294
345
  Scaffold(
295
- resizeToAvoidBottomInset: false,
346
+ resizeToAvoidBottomInset: true, // (or omit — true is the default; composer clamps to viewInsets, ENG-34434)
296
347
  body: Column(children: [
297
348
  Expanded(child: CometChatMessageList(user: user)),
298
349
  CometChatMessageComposer(user: user),
@@ -323,11 +374,11 @@ CometChatMessageComposer(textFormatters: formatters)
323
374
 
324
375
  ## Checklist
325
376
 
326
- - [ ] Scaffold has `resizeToAvoidBottomInset: false`
377
+ - [ ] Scaffold has `resizeToAvoidBottomInset: true` (or omitted — default; matches the sample app)
327
378
  - [ ] Both list and composer have matching `textFormatters`
328
379
  - [ ] Mutable `_user`/`_group` state copies, not `widget.user`/`widget.group`
329
380
  - [ ] `onThreadRepliesClick` navigates to thread screen with `parentMessageId`
330
- - [ ] Thread screen Scaffold also has `resizeToAvoidBottomInset: false` (same rule as messages screen)
381
+ - [ ] Thread screen Scaffold also uses `resizeToAvoidBottomInset: true` (same as messages screen)
331
382
  - [ ] SDK listeners update `_user`/`_group` for block/kick/scope changes
332
383
  - [ ] Colors from `CometChatThemeHelper`, cached in `didChangeDependencies()`
333
384
  - [ ] If using SDK listener mixins with `Action`, import UIKit `as cc` to avoid Flutter name conflict