@cometchat/skills 4.3.0 → 4.4.1
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/bin/install.js +27 -0
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +233 -69
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +5 -3
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +208 -28
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +232 -312
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +3 -2
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +258 -20
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +314 -35
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +5 -4
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +72 -57
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +182 -21
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +41 -19
- package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +140 -79
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +173 -45
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +36 -19
- package/skills/cometchat-native-calls/SKILL.md +29 -17
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +84 -52
- package/skills/cometchat-native-core/SKILL.md +102 -33
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +60 -29
- package/skills/cometchat-native-features/SKILL.md +24 -17
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +11 -5
- package/skills/cometchat-nextjs-patterns/SKILL.md +22 -8
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +45 -5
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +12 -6
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -9,31 +9,36 @@ Same SDK conceptual API as web/native. Flutter V5 uses GetX for state management
|
|
|
9
9
|
|
|
10
10
|
## SDK API
|
|
11
11
|
|
|
12
|
+
Raise/lower hand are **instance methods on the `CallSession` singleton**, NOT static on `CometChatCalls` (`cometchat_calls_sdk-5.0.2` `src/call_session.dart:292,306`). Participant hand events arrive via `ParticipantEventListeners`, registered through `CallSession.getInstance()?.addParticipantEventListener(...)` (`src/call_session.dart:74`).
|
|
13
|
+
|
|
12
14
|
```dart
|
|
13
|
-
import 'package:
|
|
15
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
14
16
|
|
|
15
17
|
// Local user
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
CallSession.getInstance()?.raiseHand(); // call_session.dart:292
|
|
19
|
+
CallSession.getInstance()?.lowerHand(); // call_session.dart:306
|
|
18
20
|
|
|
19
|
-
// Listener —
|
|
20
|
-
class
|
|
21
|
+
// Listener — implement the split ParticipantEventListeners interface
|
|
22
|
+
class HandListener implements ParticipantEventListeners {
|
|
21
23
|
@override
|
|
22
|
-
void onParticipantHandRaised(Participant participant) {
|
|
23
|
-
// participant.uid, participant.name
|
|
24
|
+
void onParticipantHandRaised(Participant participant) { // participant_event_listeners.dart:30
|
|
25
|
+
// participant.uid, participant.name (both nullable)
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
@override
|
|
27
|
-
void onParticipantHandLowered(Participant participant) {
|
|
29
|
+
void onParticipantHandLowered(Participant participant) { // :33
|
|
28
30
|
// ...
|
|
29
31
|
}
|
|
30
|
-
// ... other
|
|
32
|
+
// ... other ParticipantEventListeners methods (no-ops or pass-through)
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
// Register on the session singleton (inside joinSession.onSuccess):
|
|
36
|
+
CallSession.getInstance()?.addParticipantEventListener(HandListener()); // :74
|
|
37
|
+
|
|
38
|
+
// Settings flag — method on the (non-deprecated) SessionSettingsBuilder.
|
|
39
|
+
final settings = (SessionSettingsBuilder()
|
|
40
|
+
..hideRaiseHandButton(true)) // session_settings.dart:215
|
|
41
|
+
.build();
|
|
37
42
|
```
|
|
38
43
|
|
|
39
44
|
---
|
|
@@ -42,7 +47,7 @@ final builtSettings = settings.build();
|
|
|
42
47
|
|
|
43
48
|
```dart
|
|
44
49
|
import 'package:get/get.dart';
|
|
45
|
-
import 'package:
|
|
50
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
46
51
|
|
|
47
52
|
class RaisedParticipant {
|
|
48
53
|
final String uid;
|
|
@@ -51,35 +56,37 @@ class RaisedParticipant {
|
|
|
51
56
|
RaisedParticipant({required this.uid, required this.name, required this.raisedAt});
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
class RaiseHandController extends GetxController implements
|
|
59
|
+
class RaiseHandController extends GetxController implements ParticipantEventListeners {
|
|
55
60
|
final localRaised = false.obs;
|
|
56
61
|
final raised = <RaisedParticipant>[].obs;
|
|
57
62
|
|
|
58
63
|
void toggle() {
|
|
59
64
|
if (localRaised.value) {
|
|
60
|
-
|
|
65
|
+
CallSession.getInstance()?.lowerHand();
|
|
61
66
|
} else {
|
|
62
|
-
|
|
67
|
+
CallSession.getInstance()?.raiseHand();
|
|
63
68
|
}
|
|
64
69
|
localRaised.value = !localRaised.value;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
@override
|
|
68
73
|
void onParticipantHandRaised(Participant p) {
|
|
74
|
+
// Participant.uid / .name are nullable in 5.x.
|
|
75
|
+
final uid = p.uid ?? '';
|
|
69
76
|
final entry = RaisedParticipant(
|
|
70
|
-
uid:
|
|
77
|
+
uid: uid, name: p.name ?? uid, raisedAt: DateTime.now(),
|
|
71
78
|
);
|
|
72
|
-
raised.removeWhere((r) => r.uid ==
|
|
79
|
+
raised.removeWhere((r) => r.uid == uid);
|
|
73
80
|
raised.add(entry);
|
|
74
81
|
raised.sort((a, b) => a.raisedAt.compareTo(b.raisedAt));
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
@override
|
|
78
85
|
void onParticipantHandLowered(Participant p) {
|
|
79
|
-
raised.removeWhere((r) => r.uid == p.uid);
|
|
86
|
+
raised.removeWhere((r) => r.uid == (p.uid ?? ''));
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
// ... implement other
|
|
89
|
+
// ... implement other ParticipantEventListeners methods (no-ops or pass-through)
|
|
83
90
|
}
|
|
84
91
|
```
|
|
85
92
|
|
|
@@ -186,25 +193,29 @@ class RaisedHandsSheet extends StatelessWidget {
|
|
|
186
193
|
## Wiring to the call session
|
|
187
194
|
|
|
188
195
|
```dart
|
|
196
|
+
RaiseHandController? _handCtrl;
|
|
197
|
+
|
|
189
198
|
@override
|
|
190
199
|
void initState() {
|
|
191
200
|
super.initState();
|
|
192
|
-
Get.put(RaiseHandController());
|
|
193
|
-
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
_handCtrl = Get.put(RaiseHandController());
|
|
202
|
+
// NOTE: attach the listener inside joinSession.onSuccess (CallSession.getInstance()
|
|
203
|
+
// is null until the session exists). If this widget is mounted only after the
|
|
204
|
+
// session is live, attach here:
|
|
205
|
+
CallSession.getInstance()?.addParticipantEventListener(_handCtrl!); // call_session.dart:74
|
|
197
206
|
}
|
|
198
207
|
|
|
199
208
|
@override
|
|
200
209
|
void dispose() {
|
|
201
|
-
|
|
210
|
+
if (_handCtrl != null) {
|
|
211
|
+
CallSession.getInstance()?.removeParticipantEventListener(_handCtrl!); // call_session.dart:78
|
|
212
|
+
}
|
|
202
213
|
Get.delete<RaiseHandController>();
|
|
203
214
|
super.dispose();
|
|
204
215
|
}
|
|
205
216
|
```
|
|
206
217
|
|
|
207
|
-
|
|
218
|
+
The 5.x SDK identifies listeners by object identity (a `Set`), not a string ID — keep the same controller instance you registered and pass it to `removeParticipantEventListener` on dispose.
|
|
208
219
|
|
|
209
220
|
---
|
|
210
221
|
|
|
@@ -227,9 +238,9 @@ Web sister reference rules apply, plus Flutter V5-specific:
|
|
|
227
238
|
- [ ] `Obx` wraps only reactive parts of the UI
|
|
228
239
|
- [ ] `Semantics` wrapper on toggle button with `button: true, selected:, label:`
|
|
229
240
|
- [ ] `SemanticsService.announce` on toggle
|
|
230
|
-
- [ ]
|
|
241
|
+
- [ ] Same controller instance registered via `CallSession.getInstance()?.addParticipantEventListener(ctrl)` and removed via `removeParticipantEventListener(ctrl)` on dispose
|
|
231
242
|
- [ ] `Get.delete<RaiseHandController>()` in `dispose()`
|
|
232
|
-
- [ ] `hideRaiseHandButton
|
|
243
|
+
- [ ] `SessionSettingsBuilder()..hideRaiseHandButton(true)` if custom UI
|
|
233
244
|
- [ ] Real-device smoke: 3 devices (mix of iOS + Android), raise from 2 → host sees both
|
|
234
245
|
- [ ] TalkBack / VoiceOver announces "Hand raised" / "Hand lowered" on toggle
|
|
235
246
|
|
|
@@ -10,7 +10,7 @@ Same SDK shape as web/RN. Flutter-specific deltas: GetX-controlled state, flutte
|
|
|
10
10
|
|
|
11
11
|
```dart
|
|
12
12
|
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
|
|
13
|
-
import 'package:
|
|
13
|
+
import 'package:cometchat_sdk/cometchat_sdk.dart'; // Call, CallListener (Chat SDK signaling)
|
|
14
14
|
|
|
15
15
|
class CallSignalingController extends GetxController implements CallListener {
|
|
16
16
|
final incoming = Rx<Call?>(null);
|
|
@@ -56,27 +56,30 @@ class CallSignalingController extends GetxController implements CallListener {
|
|
|
56
56
|
Future<void> initiate(String receiverUid, {String type = 'video'}) async {
|
|
57
57
|
final call = Call(
|
|
58
58
|
receiverUid: receiverUid,
|
|
59
|
-
|
|
59
|
+
type: type == 'video' ? CometChatCallType.video : CometChatCallType.audio, // ctor param is `type`, not `callType`
|
|
60
60
|
receiverType: CometChatReceiverType.user,
|
|
61
61
|
);
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
// initiateCall is void + callback: the Call comes back in onSuccess, not via await.
|
|
63
|
+
CometChat.initiateCall(call,
|
|
64
|
+
onSuccess: (Call result) => outgoing.value = result,
|
|
65
|
+
onError: (CometChatException e) => debugPrint(e.message ?? ''));
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
Future<void> accept(Call call) async {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
// acceptCall takes the sessionID POSITIONALLY + onSuccess/onError; it returns void.
|
|
70
|
+
CometChat.acceptCall(call.sessionId!,
|
|
71
|
+
onSuccess: (Call result) {
|
|
72
|
+
incoming.value = null;
|
|
73
|
+
activeSessionId.value = result.sessionId;
|
|
74
|
+
},
|
|
75
|
+
onError: (CometChatException e) => debugPrint(e.message ?? ''));
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
Future<void> reject(Call call) async {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
incoming.value = null;
|
|
79
|
+
// rejectCall: positional sessionID + status String + onSuccess/onError (void).
|
|
80
|
+
CometChat.rejectCall(call.sessionId!, CometChatCallStatus.rejected,
|
|
81
|
+
onSuccess: (Call result) => incoming.value = null,
|
|
82
|
+
onError: (CometChatException e) => debugPrint(e.message ?? ''));
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
@override
|
|
@@ -62,9 +62,15 @@ void initDeepLinks() {
|
|
|
62
62
|
## SDK API
|
|
63
63
|
|
|
64
64
|
```dart
|
|
65
|
-
|
|
66
|
-
..setHideShareInviteButton(false);
|
|
65
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
67
66
|
|
|
67
|
+
final settings = (SessionSettingsBuilder()
|
|
68
|
+
..hideShareInviteButton(false)) // session_settings.dart:221
|
|
69
|
+
.build();
|
|
70
|
+
|
|
71
|
+
// The share-invite tap arrives on ButtonClickListeners
|
|
72
|
+
// (src/listener/button_click_listeners.dart:13), registered via
|
|
73
|
+
// CallSession.getInstance()?.addButtonClickListener(...) (call_session.dart:90):
|
|
68
74
|
@override
|
|
69
75
|
void onShareInviteButtonClicked() {
|
|
70
76
|
Get.find<ShareInviteController>().share(sessionId);
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-conversations
|
|
|
3
3
|
description: "Use when working with CometChat Flutter UIKit v5 conversation list component. Triggers on CometChatConversations, conversation list, recent chats."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_uikit_shared ^5.2.3"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 conversations list recent chats"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Conversations
|
|
14
15
|
|
|
15
16
|
The `CometChatConversations` component displays a list of recent conversations.
|
|
@@ -3,7 +3,6 @@ name: cometchat-flutter-v5-core
|
|
|
3
3
|
description: "Use when writing any code that uses CometChat Flutter UIKit v5 (cometchat_chat_uikit v5.2.14, cometchat_calls_uikit v5.0.15, cometchat_uikit_shared v5.2.3). Contains hard rules that prevent silent failures."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; cometchat_uikit_shared ^5.2.3; cometchat_sdk ^4.1.2; get ^4.6.5"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
@@ -12,13 +11,15 @@ metadata:
|
|
|
12
11
|
|
|
13
12
|
# CometChat Flutter UIKit v5 — Core Rules
|
|
14
13
|
|
|
14
|
+
> **Ground truth:** `cometchat_chat_uikit: ^5.2` (GetX-based; pair with `cometchat_calls_uikit: ^5.0` / raw `cometchat_calls_sdk ^5.0.2` for calls) — the pub-cache package source + `docs/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). V5 is legacy/maintenance-only (V6 is current); verify Dart symbols against the resolved package source.
|
|
15
|
+
|
|
15
16
|
Non-negotiable constraints for all CometChat UIKit v5 code. Violating these causes silent failures or crashes.
|
|
16
17
|
|
|
17
18
|
## Key v5 Architecture Facts
|
|
18
19
|
|
|
19
20
|
- State management: **GetX** (GetBuilder, GetxController, Get.put, Get.find, Get.delete)
|
|
20
21
|
- Separate packages: `cometchat_chat_uikit` + `cometchat_calls_uikit` + `cometchat_uikit_shared`
|
|
21
|
-
- SDK: `cometchat_sdk ^4.1.2` + `cometchat_calls_sdk ^4.2.2`
|
|
22
|
+
- SDK: `cometchat_sdk ^4.1.2` + `cometchat_calls_sdk ^4.2.2` (chat-kit baseline). **For voice/video calling, do NOT use `cometchat_calls_uikit` (4.x-bound) — integrate the raw `cometchat_calls_sdk ^5.0.2` per `cometchat-flutter-v5-calls`** (the V5-canonical calls path).
|
|
22
23
|
- **Imports — two barrels.** For chat-only projects: `package:cometchat_chat_uikit/cometchat_chat_uikit.dart`. For projects that also need voice/video calling: ADD `package:cometchat_calls_uikit/cometchat_calls_uikit.dart` as a SECOND import — the calls barrel re-exports shared + SDK only and does NOT re-export `cometchat_chat_uikit`. Chat widgets like `CometChatConversations`, `CometChatMessageList`, `CometChatMessageComposer` are reachable only through the chat barrel.
|
|
23
24
|
- `CometChatUIKit.login(uid)` takes a **String** directly (not an object)
|
|
24
25
|
- No ServiceLocator pattern — controllers are created via `Get.put()` internally
|
|
@@ -227,7 +228,7 @@ void dispose() {
|
|
|
227
228
|
**The full recipe lives in `cometchat-flutter-v6-core` §"Visual Builder integration"** because that's where the V6-prep restructure originally landed the validated content. Both skills reference the same canonical; the V6 page carries a "V5-shaped code" warning at the top. V5 customers should follow that recipe AS-IS — the canonical IS V5-targeted.
|
|
228
229
|
|
|
229
230
|
Validated 2026-05-21 against Flutter 3.38.3: `flutter build apk --debug` produces `app-debug.apk` after applying:
|
|
230
|
-
- Envelope-wrapped JSON at `chat_builder/assets/sample_app/cometchat-builder-settings.json
|
|
231
|
+
- Envelope-wrapped JSON at `chat_builder/assets/sample_app/cometchat-builder-settings.json`. The CLI (source of truth) writes `{ builderId, name, settings: {...} }`; the vendor canonical's own checked-in file carries only `{ builderId, settings }` (no `name`). `BuilderSettingsHelper.loadFromAsset()` reads only `builderId` + `settings` and ignores any extra top-level keys, so the CLI's extra `name` is harmless.
|
|
231
232
|
- Two missing-field defaults injected pre-write (mentionAll + inAppSounds — same as Android)
|
|
232
233
|
- `android.enableJetifier=true` in `android/gradle.properties` (the chat SDK pulls `com.android.support` transitively)
|
|
233
234
|
- `await BuilderSettingsHelper.loadFromAsset()` in `lib/main.dart` before `runApp()`
|
|
@@ -235,4 +236,4 @@ Validated 2026-05-21 against Flutter 3.38.3: `flutter build apk --debug` produce
|
|
|
235
236
|
|
|
236
237
|
Differences from the V6 page's recipe text:
|
|
237
238
|
- V5 host code uses `StatefulWidget` with direct listener management (V6 uses BLoC pattern); both work with the embedded chat_builder package since it owns its own state.
|
|
238
|
-
- V5 calls
|
|
239
|
+
- V5 calls (the standalone `cometchat-flutter-v5-calls` flow, outside the builder) don't need the [[project_v6_flutter_calls_partial]] navigatorKey workaround — that's a V6-specific incoming-call-routing requirement. **However, the Visual Builder canonical itself (V5-shaped) wires `navigatorKey: CallNavigationContext.navigatorKey` UNCONDITIONALLY in every `MaterialApp` `ChatBuilder.createApp()` builds**, regardless of whether calls are enabled — so if you mount `ChatBuilder.createApp()` (recommended) or replicate its `MaterialApp` in a host wrapper, keep that navigator key in place. Do NOT gate it behind "calls enabled". See the v6-core recipe's wrapper guidance.
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-customization
|
|
|
3
3
|
description: "Use when customizing CometChat Flutter UIKit v5 beyond props — custom bubbles, templates, DataSource decorators, slot views, formatters."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_uikit_shared ^5.2.3"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 customization templates datasource decorator bubbles formatters"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Customization
|
|
14
15
|
|
|
15
16
|
Four tiers of customization, from simple to deep.
|
|
@@ -60,7 +61,7 @@ CometChatMessageHeader(
|
|
|
60
61
|
|
|
61
62
|
Available slot views per component:
|
|
62
63
|
- `CometChatConversations`: `subtitleView`, `listItemView`, `trailingView`, `leadingView`, `titleView`
|
|
63
|
-
- `CometChatMessageHeader`: `subtitleView`, `listItemView`, `trailingView`
|
|
64
|
+
- `CometChatMessageHeader`: `subtitleView`, `listItemView`, `trailingView`, `titleView`
|
|
64
65
|
- `CometChatMessageList`: `headerView`, `footerView`, `loadingStateView`, `emptyStateView`, `errorStateView`
|
|
65
66
|
- `CometChatUsers`: `subtitleView`, `listItemView`, `leadingView`, `titleView`, `trailingView`
|
|
66
67
|
- `CometChatGroups`: `subtitleView`, `listItemView`, `leadingView`, `titleView`, `trailingView`
|
|
@@ -138,12 +139,16 @@ final settings = (UIKitSettingsBuilder()
|
|
|
138
139
|
| Polls | `PollsExtensionDecorator` | Poll creation + voting bubble |
|
|
139
140
|
| Stickers | `StickersExtensionDecorator` | Sticker keyboard + bubble |
|
|
140
141
|
| Link Preview | `LinkPreviewExtensionDecorator` | URL preview cards |
|
|
141
|
-
| Message Translation | `
|
|
142
|
+
| Message Translation | `MessageExtensionTranslationDecorator` | Translate option |
|
|
142
143
|
| Image Moderation | `ImageModerationExtensionDecorator` | NSFW filter |
|
|
143
144
|
| Collaborative Document | `CollaborativeDocumentExtensionDecorator` | Shared doc |
|
|
144
|
-
| Collaborative Whiteboard | `
|
|
145
|
+
| Collaborative Whiteboard | `CollaborativeWhiteBoardExtensionDecorator` | Shared whiteboard |
|
|
145
146
|
| Thumbnail Generation | `ThumbnailGenerationExtensionDecorator` | Image thumbnails |
|
|
146
147
|
|
|
148
|
+
> **Naming gotchas (kit-side inconsistencies)** — two decorator class names break the `[Feature]ExtensionDecorator` convention used by the other six. Use these exact spellings when subclassing or importing:
|
|
149
|
+
> - `CollaborativeWhiteBoardExtensionDecorator` — capital **B** in `WhiteBoard` (matches the kit's typo; lowercase `b` will not resolve).
|
|
150
|
+
> - `MessageExtensionTranslationDecorator` — token order is **inverted**; the public wrapper is `MessageTranslationExtension`, but the decorator itself uses `MessageExtensionTranslation`.
|
|
151
|
+
|
|
147
152
|
### CometChatCallingExtension
|
|
148
153
|
|
|
149
154
|
The calling extension also uses this pattern:
|
|
@@ -164,7 +169,8 @@ class CometChatCallingExtension extends ExtensionsDataSource {
|
|
|
164
169
|
|
|
165
170
|
```dart
|
|
166
171
|
CometChatMessageList(
|
|
167
|
-
|
|
172
|
+
// ✅ APPEND with addTemplate — keeps every default bubble (text/image/video/file/…)
|
|
173
|
+
addTemplate: [
|
|
168
174
|
CometChatMessageTemplate(
|
|
169
175
|
type: 'custom_type',
|
|
170
176
|
category: 'custom',
|
|
@@ -178,6 +184,127 @@ CometChatMessageList(
|
|
|
178
184
|
)
|
|
179
185
|
```
|
|
180
186
|
|
|
187
|
+
> **Use `addTemplate`, not `templates`, to add a type.** The `templates:` prop **replaces the entire set** — passing `templates: [myTemplate]` makes every default bubble (text, image, video, audio, file, …) stop rendering. `addTemplate:` layers your template on top of the defaults. Only reach for `templates:` when you deliberately want to redefine the whole list.
|
|
188
|
+
|
|
189
|
+
> `contentView` also accepts an optional named `{AdditionalConfigurations? additionalConfigurations}` arg if your custom bubble needs access to additional config passed down from the parent.
|
|
190
|
+
|
|
191
|
+
### Custom attachment options — append via a DataSourceDecorator (super), don't replace
|
|
192
|
+
|
|
193
|
+
The composer's `attachmentOptions` builder returns the **whole** menu (a `ComposerActionsBuilder` — `(context, user, group, id)`), so returning `[myAction]` wipes photo/video/audio/file. The kit's own extensions add options by overriding `DataSource.getAttachmentOptions` and calling `super` first — do the same:
|
|
194
|
+
|
|
195
|
+
```dart
|
|
196
|
+
class MyDataSource extends DataSourceDecorator {
|
|
197
|
+
MyDataSource(DataSource ds) : super(ds);
|
|
198
|
+
|
|
199
|
+
@override
|
|
200
|
+
List<CometChatMessageComposerAction> getAttachmentOptions(
|
|
201
|
+
BuildContext context, Map<String, dynamic>? id,
|
|
202
|
+
AdditionalConfigurations? additionalConfigurations,
|
|
203
|
+
) {
|
|
204
|
+
final actions = super.getAttachmentOptions(context, id, additionalConfigurations); // defaults
|
|
205
|
+
actions.add(CometChatMessageComposerAction(
|
|
206
|
+
id: 'location', title: 'Send Location',
|
|
207
|
+
onItemClick: (ctx, user, group) { /* pick + send (below) */ },
|
|
208
|
+
));
|
|
209
|
+
return actions; // appended — defaults preserved
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Sending a custom message — use the UIKit path, not the raw SDK
|
|
215
|
+
|
|
216
|
+
```dart
|
|
217
|
+
final message = CustomMessage(
|
|
218
|
+
receiverUid: user.uid,
|
|
219
|
+
receiverType: ReceiverTypeConstants.user, // or .group
|
|
220
|
+
type: 'custom_type', // matches the template type
|
|
221
|
+
customData: {'lat': 19.07, 'lng': 72.87},
|
|
222
|
+
);
|
|
223
|
+
// ✅ kit path — sets muid + sender, emits ccMessageSent → list appends
|
|
224
|
+
await CometChatUIKit.sendCustomMessage(message);
|
|
225
|
+
// ❌ await CometChat.sendCustomMessage(message); // recipient error + realtime replace
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Override an existing type's bubble
|
|
229
|
+
|
|
230
|
+
To swap the content of a **built-in** type (e.g. text), **do NOT use `addTemplate:`** — a built-in collision passed via `addTemplate:` is silently dropped (the list controller backfills only *null* slots, and the default's `contentView`/`options` are already non-null; source: `chat_uikit/.../message_list/cometchat_message_list_controller.dart:571-613`). `addTemplate:` is for brand-NEW custom types only.
|
|
231
|
+
|
|
232
|
+
To override a built-in, **seed the full default set, modify the matching template in place, and pass the whole list via `templates:`** (the prop that defines the list's template set — passing the complete set guarantees no other built-in bubble is dropped). `contentView`'s full signature is `(BaseMessage, BuildContext, BubbleAlignment, {AdditionalConfigurations? additionalConfigurations})`.
|
|
233
|
+
|
|
234
|
+
```dart
|
|
235
|
+
final templates = CometChatUIKit.getDataSource().getAllMessageTemplates();
|
|
236
|
+
for (final t in templates) {
|
|
237
|
+
if (t.type == MessageTypeConstants.text &&
|
|
238
|
+
t.category == MessageCategoryConstants.message) {
|
|
239
|
+
t.contentView = (message, context, alignment, {additionalConfigurations}) {
|
|
240
|
+
return Container(
|
|
241
|
+
padding: const EdgeInsets.all(8),
|
|
242
|
+
child: Text(message is TextMessage ? message.text : ''),
|
|
243
|
+
);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
CometChatMessageList(user: user, templates: templates) // full set → no built-in dropped
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Message option — add a long-press action (Forward-style)
|
|
252
|
+
|
|
253
|
+
Two verified routes:
|
|
254
|
+
|
|
255
|
+
**A. Per-list, via the template's `options` callback.** The template's `options` signature is `(User loggedInUser, BaseMessage messageObject, BuildContext context, Group? group, AdditionalConfigurations? additionalConfigurations)` and returns `List<CometChatMessageOption>?`. Because this overrides a **built-in** type's `options`, use the same seed-the-full-set + `templates:` pattern as the bubble override above (NOT `addTemplate:`, which would be dropped). Seed each option list from the default `getMessageOptions` to **append** rather than replace:
|
|
256
|
+
|
|
257
|
+
```dart
|
|
258
|
+
final templates = CometChatUIKit.getDataSource().getAllMessageTemplates();
|
|
259
|
+
for (final t in templates) {
|
|
260
|
+
if (t.type == MessageTypeConstants.text &&
|
|
261
|
+
t.category == MessageCategoryConstants.message) {
|
|
262
|
+
t.options = (loggedInUser, message, context, group, additionalConfigurations) {
|
|
263
|
+
final defaults = CometChatUIKit.getDataSource().getMessageOptions(
|
|
264
|
+
loggedInUser, message, context, group, additionalConfigurations);
|
|
265
|
+
defaults.add(CometChatMessageOption(
|
|
266
|
+
id: 'forward',
|
|
267
|
+
title: 'Forward',
|
|
268
|
+
icon: const Icon(Icons.forward, size: 24),
|
|
269
|
+
onItemClick: (BaseMessage msg, CometChatMessageListControllerProtocol state) {
|
|
270
|
+
// forward msg
|
|
271
|
+
},
|
|
272
|
+
));
|
|
273
|
+
return defaults; // appended — default options preserved
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
CometChatMessageList(user: user, templates: templates)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**B. App-wide, via a `DataSourceDecorator`.** Override `getMessageOptions` and call `super` first (same shape the kit's own extensions use):
|
|
282
|
+
|
|
283
|
+
```dart
|
|
284
|
+
class MyDataSource extends DataSourceDecorator {
|
|
285
|
+
MyDataSource(DataSource ds) : super(ds);
|
|
286
|
+
|
|
287
|
+
@override
|
|
288
|
+
List<CometChatMessageOption> getMessageOptions(
|
|
289
|
+
User loggedInUser, BaseMessage messageObject, BuildContext context,
|
|
290
|
+
Group? group, AdditionalConfigurations? additionalConfigurations,
|
|
291
|
+
) {
|
|
292
|
+
final options = super.getMessageOptions(
|
|
293
|
+
loggedInUser, messageObject, context, group, additionalConfigurations);
|
|
294
|
+
options.add(CometChatMessageOption(
|
|
295
|
+
id: 'forward', title: 'Forward',
|
|
296
|
+
onItemClick: (msg, state) { /* forward */ },
|
|
297
|
+
));
|
|
298
|
+
return options; // appended — defaults preserved
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// register: ChatConfigurator.enable((ds) => MyDataSource(ds));
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
> `CometChatMessageOption.onItemClick` is `(BaseMessage message, CometChatMessageListControllerProtocol state)` — **not** the bare `Function()` used by `CometChatOption` (conversations/header). Don't mix the two models.
|
|
305
|
+
|
|
306
|
+
Verified (v5): `CometChatMessageList.addTemplate` + `.templates` (chat_uikit/.../message_list/cometchat_message_list.dart:108,55), `CometChatMessageTemplate({required type, required category, bubbleView, headerView, contentView, footerView, bottomView, statusInfoView, threadView, replyView, options})` (shared_uikit/.../models/cometchat_message_template.dart:21; `contentView` 3-arg + `{AdditionalConfigurations?}`, `options` 5 positional), `DataSourceDecorator.getAttachmentOptions(BuildContext, Map?, AdditionalConfigurations?)` + `.getMessageOptions(User, BaseMessage, BuildContext, Group?, AdditionalConfigurations?)` (shared_uikit/.../framework/data_source_decorator.dart:47,122 — both delegate to wrapped `dataSource`, so `super.x()` is correct), `ChatConfigurator.enable(DataSource Function(DataSource))` + `CometChatUIKit.getDataSource()` (shared_uikit/.../framework/chat_configurator.dart:14, cometchat_ui_kit.dart:713), `CometChatMessageOption(id:, title:, icon:, onItemClick:(BaseMessage,CometChatMessageListControllerProtocol), messageOptionSheetStyle:)` (shared_uikit/.../models/cometchat_message_option.dart:21), `CometChatMessageComposerAction(id:, title:, icon:, style:, onItemClick:(BuildContext,User?,Group?))` (shared_uikit/.../models/cometchat_message_composer_action.dart:23), `CometChatUIKit.sendCustomMessage(CustomMessage)`, `CustomMessage(receiverUid:, receiverType:, type:, customData:)`.
|
|
307
|
+
|
|
181
308
|
## Options Menu Customization
|
|
182
309
|
|
|
183
310
|
Add or replace long-press options on conversations, users, groups:
|
|
@@ -225,3 +352,7 @@ CometChatMessageHeader(
|
|
|
225
352
|
- [ ] Text formatters consistent between MessageList and Composer
|
|
226
353
|
- [ ] Extensions registered via `UIKitSettingsBuilder.extensions`
|
|
227
354
|
- [ ] Custom templates specify `type` and `category`
|
|
355
|
+
|
|
356
|
+
## Sound (in-app message + call sounds)
|
|
357
|
+
|
|
358
|
+
The V5 UI Kit surfaces `CometChatSoundManager` for incoming/outgoing message + call sounds (mute / custom audio). **V5 is legacy/maintenance-only** — V6 is the current cohort. For call sounds see this family's `-calls` skill; verify the `CometChatSoundManager` API against the installed kit before relying on it.
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-events
|
|
|
3
3
|
description: "Use when working with CometChat Flutter UIKit v5 event system. Triggers on CometChatMessageEvents, CometChatUserEvents, CometChatGroupEvents, CometChatCallEvents, CometChatUIEvents, listeners."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_uikit_shared ^5.2.3; cometchat_sdk ^4.1.2"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 events listeners real-time typing receipts"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Events
|
|
14
15
|
|
|
15
16
|
Two layers: SDK listeners (low-level) and UIKit events (high-level component coordination).
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-messages
|
|
|
3
3
|
description: "Use when working with CometChat Flutter UIKit v5 message components. Triggers on CometChatMessageList, CometChatMessageComposer, CometChatCompactMessageComposer, CometChatMessageHeader, threads."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_uikit_shared ^5.2.3"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 messages list composer header bubbles threads compact"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Messages
|
|
14
15
|
|
|
15
16
|
Components for displaying, sending, and managing messages.
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-production
|
|
|
3
3
|
description: "Use when preparing a CometChat Flutter UIKit v5 app for production. Covers auth tokens, ProGuard, environment config, security hardening."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 production security auth tokens proguard environment"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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/fundamentals/user-auth · **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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Production
|
|
14
15
|
|
|
15
16
|
Hardening a CometChat Flutter app for production deployment.
|
|
@@ -67,12 +68,14 @@ android.useAndroidX=true
|
|
|
67
68
|
android.enableJetifier=true
|
|
68
69
|
```
|
|
69
70
|
|
|
70
|
-
### minSdk
|
|
71
|
+
### minSdk
|
|
71
72
|
|
|
72
73
|
```groovy
|
|
73
74
|
// android/app/build.gradle
|
|
74
75
|
defaultConfig {
|
|
75
|
-
minSdk
|
|
76
|
+
minSdk 24 // Matches vendor samples (sample_app + sample_app_push_notifications + calls_uikit android/build.gradle).
|
|
77
|
+
// Raw calls-sdk docs cite 26; the UI Kit wrapper relaxes to 24 for chat-only apps.
|
|
78
|
+
// Bump to 26 ONLY if your app uses calls AND fails at runtime with a min-SDK error from the calls plugin.
|
|
76
79
|
}
|
|
77
80
|
```
|
|
78
81
|
|
|
@@ -180,8 +183,14 @@ CometChat.setDemoMetaInfo(jsonObject: {
|
|
|
180
183
|
## Logout Flow
|
|
181
184
|
|
|
182
185
|
```dart
|
|
183
|
-
// 1. Unregister push tokens
|
|
184
|
-
|
|
186
|
+
// 1. Unregister push tokens — real SDK API:
|
|
187
|
+
await CometChatNotifications.unregisterPushToken(
|
|
188
|
+
onSuccess: (_) {},
|
|
189
|
+
onError: (e) {},
|
|
190
|
+
);
|
|
191
|
+
// (PNRegistry.unregisterPNService() only works if you copied the v5 sample-app
|
|
192
|
+
// `extension PNRegistry on CometChatService` helper into your project — it is
|
|
193
|
+
// NOT importable from any cometchat_* package. See cometchat-flutter-v5-push.)
|
|
185
194
|
|
|
186
195
|
// 2. Sign out from Firebase/Google (if applicable)
|
|
187
196
|
await FirebaseAuth.instance.signOut();
|
|
@@ -199,7 +208,7 @@ await CometChatUIKit.logout(
|
|
|
199
208
|
- [ ] Auth tokens minted server-side, not authKey in client
|
|
200
209
|
- [ ] Credentials not hardcoded in source (use SharedPreferences or remote config)
|
|
201
210
|
- [ ] ProGuard rules added for release builds
|
|
202
|
-
- [ ] minSdk 26
|
|
211
|
+
- [ ] minSdk 24 set (or 26 if your app uses calls AND hits min-SDK runtime errors)
|
|
203
212
|
- [ ] iOS permissions in Info.plist
|
|
204
213
|
- [ ] Firebase Crashlytics configured
|
|
205
214
|
- [ ] Push notification provider IDs match CometChat dashboard
|
|
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5-push
|
|
|
3
3
|
description: "Use when implementing push notifications with CometChat Flutter UIKit v5. Covers FCM (Android), APNs (iOS), VoIP calls, token lifecycle, local notifications, and tap-to-navigate."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; firebase_messaging; flutter_local_notifications; flutter_callkit_incoming"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat flutter v5 push notifications fcm apns voip callkit firebase"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **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/notifications/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.
|
|
13
|
+
|
|
13
14
|
# CometChat Flutter UIKit v5 — Push Notifications
|
|
14
15
|
|
|
15
16
|
Push notification setup for Android (FCM) and iOS (APNs + VoIP).
|