Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions sdk/flutter/real-time-listeners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
1. [UserListener](#user-listener)
2. [GroupListener](#group-listener)
3. [MessageListener](#message-listener)
4. [AIAssistantListener](#ai-assistant-listener)

## User Listener

Expand All @@ -25,7 +26,7 @@
<Tabs>
<Tab title="Dart">
```dart
class Class_Name with UserListener {

Check warning on line 29 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L29

Did you really mean 'Class_Name'?
//CometChat.addUserListener("user_Listener_id", this);
@override
void onUserOnline(User user) {
Expand Down Expand Up @@ -77,7 +78,7 @@
<Tabs>
<Tab title="Dart">
```dart
class Class_Name with GroupListener {

Check warning on line 81 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L81

Did you really mean 'Class_Name'?
//CometChat.addGroupListener("UNIQUE_LISTENER_ID", this);

@override
Expand All @@ -86,32 +87,32 @@
}

@override
void onGroupMemberLeft(Action action, User leftUser, Group leftGroup) {

Check warning on line 90 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L90

Did you really mean 'leftUser'?

Check warning on line 90 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L90

Did you really mean 'leftGroup'?

}

@override
void onGroupMemberKicked(Action action, User kickedUser, User kickedBy, Group kickedFrom) {

Check warning on line 95 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L95

Did you really mean 'kickedUser'?

Check warning on line 95 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L95

Did you really mean 'kickedBy'?

Check warning on line 95 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L95

Did you really mean 'kickedFrom'?

}

@override
void onGroupMemberBanned(Action action, User bannedUser, User bannedBy, Group bannedFrom) {

Check warning on line 100 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L100

Did you really mean 'bannedUser'?

Check warning on line 100 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L100

Did you really mean 'bannedBy'?

Check warning on line 100 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L100

Did you really mean 'bannedFrom'?

}

@override
void onGroupMemberUnbanned(Action action, User unbannedUser, User unbannedBy, Group unbannedFrom) {

Check warning on line 105 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L105

Did you really mean 'unbannedUser'?

Check warning on line 105 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L105

Did you really mean 'unbannedBy'?

Check warning on line 105 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L105

Did you really mean 'unbannedFrom'?

}

@override
void onGroupMemberScopeChanged(Action action, User updatedBy, User updatedUser, String scopeChangedTo, String scopeChangedFrom, Group group) {

Check warning on line 110 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L110

Did you really mean 'updatedBy'?

Check warning on line 110 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L110

Did you really mean 'updatedUser'?

}

@override
void onMemberAddedToGroup(Action action, User addedby, User userAdded, Group addedTo) {

Check warning on line 115 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L115

Did you really mean 'addedby'?

Check warning on line 115 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L115

Did you really mean 'userAdded'?

Check warning on line 115 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L115

Did you really mean 'addedTo'?

}

Expand Down Expand Up @@ -157,13 +158,16 @@
| `onTransientMessageReceived(TransientMessage transientMessage)` | This event is triggered when a Transient Message is received. |
| `onMessageReactionAdded(ReactionEvent reactionEvent)` | This event is triggered when a reaction is added to a message in a user/group conversation. |
| `onMessageReactionRemoved(ReactionEvent reactionEvent)` | This event is triggered when a reaction is remove from a message in a user/group conversation. |
| `onAIAssistantMessageReceived(AIAssistantMessage message)` | This event is triggered when a persisted AI Assistant message is received after a run completes. |
| `onAIToolResultReceived(AIToolResultMessage message)` | This event is triggered when an AI tool result message is received. |
| `onAIToolArgumentsReceived(AIToolArgumentMessage message)` | This event is triggered when AI tool argument messages are received. |

To add the `MessageListener`, you need to use the `addMessageListener()` method provided by the `CometChat` class.

<Tabs>
<Tab title="Dart">
```dart
class Class_Name with MessageListener {

Check warning on line 170 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L170

Did you really mean 'Class_Name'?

//CometChat.addMessageListener("listenerId", this);
@override
Expand All @@ -172,33 +176,33 @@
}

@override
void onMediaMessageReceived(MediaMessage mediaMessage) {

Check warning on line 179 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L179

Did you really mean 'mediaMessage'?

}

@override
void onCustomMessageReceived(CustomMessage customMessage) {

Check warning on line 184 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L184

Did you really mean 'customMessage'?

}

@override
void onTypingStarted(TypingIndicator typingIndicator) {

Check warning on line 189 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L189

Did you really mean 'typingIndicator'?

}

@override
void onTypingEnded(TypingIndicator typingIndicator) {

Check warning on line 194 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L194

Did you really mean 'typingIndicator'?

}


@override
void onMessagesDelivered(MessageReceipt messageReceipt) {

Check warning on line 200 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L200

Did you really mean 'messageReceipt'?

}

@override
void onMessagesRead(MessageReceipt messageReceipt) {

Check warning on line 205 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L205

Did you really mean 'messageReceipt'?

}

Expand All @@ -224,26 +228,41 @@
}

@override
void onCardMessageReceived(CardMessage cardMessage) {

Check warning on line 231 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L231

Did you really mean 'cardMessage'?

}


@override
void onTransientMessageReceived(TransientMessage transientMessage) {

Check warning on line 237 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L237

Did you really mean 'transientMessage'?

}

@override
void onMessageReactionAdded(ReactionEvent reactionEvent) {

Check warning on line 242 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L242

Did you really mean 'reactionEvent'?

}

@override
void onMessageReactionRemoved(ReactionEvent reactionEvent) {

Check warning on line 247 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L247

Did you really mean 'reactionEvent'?

}

@override
void onAIAssistantMessageReceived(AIAssistantMessage aiAssistantMessage) {

}

@override
void onAIToolResultReceived(AIToolResultMessage aiToolResultMessage) {

}

@override
void onAIToolArgumentsReceived(AIToolArgumentMessage aiToolArgumentMessage) {

}

}
```

Expand All @@ -254,3 +273,60 @@
where `UNIQUE_LISTENER_ID` is the unique identifier for the listener. Please make sure that no two listeners are added with the same listener id as this could lead to unexpected behavior resulting in loss of events.

Once the activity/fragment where the `MessageListener` is declared is not in use, you need to remove the listener using the `removeMessageListener()` method which takes the id of the listener to be removed as the parameter. We suggest you call this method in the `onPause()` method of the activity/fragment.

## AI Assistant Listener

The `AIAssistantListener` class provides you with real-time streaming events from AI Agent runs. These events are emitted during a run lifecycle and include tool calls, card generation, and text message streaming. For a complete overview of the event lifecycle, see [AI Agents](/sdk/flutter/ai-agents).

| Method | Information |
| --- | --- |
| `onAIAssistantEventReceived(AIAssistantBaseEvent event)` | This event is triggered for every AI assistant streaming event during a run (run start/finish, tool calls, card generation, text streaming). |

To add the `AIAssistantListener`, use the `addAIAssistantListener()` method provided by the `CometChat` class.

<Tabs>
<Tab title="Dart">
```dart
class Class_Name with AIAssistantListener {
CometChat.addAIAssistantListener("UNIQUE_LISTENER_ID", this);

@override
void onAIAssistantEventReceived(AIAssistantBaseEvent event) {
// Handle different event types
if (event is AIAssistantRunStartedEvent) {
debugPrint("Run started: ${event.id}");
} else if (event is AIAssistantToolStartedEvent) {
debugPrint("Tool call started");
} else if (event is AIAssistantCardStartedEvent) {
debugPrint("Card generation started: ${event.cardId}");
} else if (event is AIAssistantCardReceivedEvent) {
final cardPayload = event.getCard();
debugPrint("Card received: ${event.cardId}");
} else if (event is AIAssistantCardEndedEvent) {
debugPrint("Card ended: ${event.cardId}");
} else if (event is AIAssistantContentReceivedEvent) {
debugPrint("Streaming content delta: ${event.delta}");
} else if (event is AIAssistantMessageEndedEvent) {
debugPrint("Message streaming ended");
} else if (event is AIAssistantRunFinishedEvent) {
debugPrint("Run finished: ${event.id}");
}
}
}
```
</Tab>
</Tabs>

To remove the listener:

<Tabs>
<Tab title="Dart">
```dart
CometChat.removeAIAssistantListener("UNIQUE_LISTENER_ID");
```
</Tab>
</Tabs>

<Note>
The `AIAssistantListener` delivers real-time streaming events. After a run completes, persisted agentic messages (`AIAssistantMessage`, `AIToolResultMessage`, `AIToolArgumentMessage`) are delivered via the `MessageListener` callbacks listed above.

Check warning on line 331 in sdk/flutter/real-time-listeners.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

sdk/flutter/real-time-listeners.mdx#L331

Did you really mean 'agentic'?
</Note>
22 changes: 3 additions & 19 deletions ui-kit/flutter/call-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,12 @@

### Step 1: Add Dependency

Since V6 is hosted on Cloudsmith, install via CLI:
Add the dependency to your `pubspec.yaml`:

<Tabs>
<Tab title="Dart">
```bash
dart pub add cometchat_chat_uikit:6.0.0 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/
```
</Tab>
</Tabs>

Or add manually to `pubspec.yaml`:

<Tabs>
<Tab title="Dart">
```yaml
```yaml pubspec.yaml
dependencies:
cometchat_chat_uikit:
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
version: 6.0.0
cometchat_chat_uikit: ^6.0.4
```
</Tab>
</Tabs>

***

Expand All @@ -43,7 +27,7 @@
<Tabs>
<Tab title="Groovy">
```gradle
defaultConfig {

Check warning on line 30 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L30

Did you really mean 'defaultConfig'?
minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
Expand All @@ -55,7 +39,7 @@

***

### Step 3: Update iOS Podfile

Check warning on line 42 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L42

Did you really mean 'Podfile'?

In `ios/Podfile`, set the minimum iOS version to 12:

Expand All @@ -72,7 +56,7 @@
<Tabs>
<Tab title="Dart">
```dart
UIKitSettings uiKitSettings = (UIKitSettingsBuilder()

Check warning on line 59 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L59

'uiKitSettings' is repeated!
..subscriptionType = CometChatSubscriptionType.allUsers
..autoEstablishSocketConnection = true
..region = "REGION"
Expand All @@ -83,8 +67,8 @@
).build();

CometChatUIKit.init(uiKitSettings: uiKitSettings,
onSuccess: (successMessage) {},

Check warning on line 70 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L70

Did you really mean 'onSuccess'?

Check warning on line 70 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L70

Did you really mean 'successMessage'?
onError: (e) {},

Check warning on line 71 in ui-kit/flutter/call-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/call-features.mdx#L71

Did you really mean 'onError'?
);
```
</Tab>
Expand Down
20 changes: 2 additions & 18 deletions ui-kit/flutter/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

* Flutter installed on your system.
* Android Studio or VS Code with configured Flutter/Dart plugins.
* Xcode & Pod (CocoaPods) for iOS.

Check warning on line 30 in ui-kit/flutter/getting-started.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/getting-started.mdx#L30

Did you really mean 'Xcode'?
* An iOS device or emulator with iOS 13.0 or above.
* Android device or emulator with Android version 7.0 (API 24) or above.

Expand All @@ -41,23 +41,9 @@

### **Step 2: Add Dependency**

**1. Install via CLI**

Since V6 is hosted on Cloudsmith (not pub.dev), run this command instead of the standard `flutter pub add`:

```bash
dart pub add cometchat_chat_uikit:6.0.0 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/
```

**2. Update Pubspec**

Or add it manually to your `pubspec.yaml`:

```yaml pubspec.yaml
dependencies:
cometchat_chat_uikit:
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
version: 6.0.0
cometchat_chat_uikit: ^6.0.4
```

Final `pubspec.yaml`
Expand All @@ -77,9 +63,7 @@
flutter:
sdk: flutter

cometchat_chat_uikit:
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
version: 6.0.0
cometchat_chat_uikit: ^6.0.4

cupertino_icons: ^1.0.8

Expand Down Expand Up @@ -110,9 +94,9 @@

***

**3. Update iOS Podfile**

Check warning on line 97 in ui-kit/flutter/getting-started.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/getting-started.mdx#L97

Did you really mean 'Podfile'?

In your Podfile (located at `ios/Podfile`), update the minimum iOS version:

Check warning on line 99 in ui-kit/flutter/getting-started.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/getting-started.mdx#L99

Did you really mean 'Podfile'?

```ruby Podfile
platform :ios, '13.0'
Expand All @@ -120,7 +104,7 @@

***

**4. Import CometChat UIKit**

Check warning on line 107 in ui-kit/flutter/getting-started.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/getting-started.mdx#L107

Did you really mean 'UIKit'?

In your Dart code, import the CometChat UIKit package:

Expand Down
56 changes: 56 additions & 0 deletions ui-kit/flutter/methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

| Method | Type | Description |
|---|---|---|
| appId | String | Sets the unique ID for the app, available on dashboard |

Check warning on line 22 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L22

Did you really mean 'appId'?
| region | String | Sets the region for the app ('us' or 'eu' or 'in') |

Check warning on line 23 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L23

Did you really mean 'eu'?
| authKey | String | Sets the auth key for the app, available on dashboard |

Check warning on line 24 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L24

Did you really mean 'authKey'?
| subscriptionType | String | Sets subscription type for tracking the presence of all users |

Check warning on line 25 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L25

Did you really mean 'subscriptionType'?
| roles | String | Sets subscription type for tracking the presence of users with specified roles |
| autoEstablishSocketConnection | Boolean | Configures if web socket connections will be established automatically on app initialization or be done manually, set to true by default |

Expand Down Expand Up @@ -193,3 +193,59 @@
..dateTimeFormatterCallback = DateFormatter()
).build();
```

## AI Assistant Events

The UI Kit provides a UI-level event system for AI assistant interactions via `CometChatAIAssistantEvents`. These events mirror the SDK-level `AIAssistantListener` but are scoped to the UI layer for component-level reactions.

### Add Listener

```dart
CometChatAIAssistantEvents.addAIAssistantListener(
"unique_listener_id",
myListener,
);
```

### Remove Listener

```dart
CometChatAIAssistantEvents.removeAIAssistantListener("unique_listener_id");
```

### Listener Interface

Implement `CometChatAIAssistantEventsListener` to receive events:

```dart
class MyListener with CometChatAIAssistantEventsListener {
@override
void onAIAssistantEventReceived(AIAssistantBaseEvent event) {
// Handle AI assistant streaming events at the UI layer
}
}
```

<Note>
The UIKit's `CometChatMessageList` automatically handles AI events internally. Use `CometChatAIAssistantEvents` only if you need additional custom UI reactions to AI streaming events.

Check warning on line 230 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L230

Did you really mean 'UIKit's'?
</Note>

## UI Events — Card Actions

When a user interacts with a card button inside an AI agent response or a standalone card message, the UIKit emits a `ccCardActionClicked` event:

Check warning on line 235 in ui-kit/flutter/methods.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/methods.mdx#L235

Did you really mean 'UIKit'?

```dart
CometChatUIEvents.addUiListener("card_listener", myUIListener);

class MyUIListener with CometChatUIEventListener {
@override
void ccCardActionClicked(BaseMessage message, dynamic action) {
if (action is CometChatCardActionEvent) {
debugPrint("Element ID: ${action.elementId}");
debugPrint("Action: ${action.action}");
debugPrint("Card JSON: ${action.cardJson}");
// Handle navigation, API calls, etc.
}
}
}
```
14 changes: 2 additions & 12 deletions ui-kit/flutter/upgrading-from-v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,9 @@

### 4. Update Dependencies

**Install V6 via CLI (hosted on Cloudsmith):**

```bash
dart pub add cometchat_chat_uikit:6.0.0 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/
```

Or add manually to `pubspec.yaml`:

```yaml
```yaml pubspec.yaml
dependencies:
cometchat_chat_uikit:
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
version: 6.0.0
cometchat_chat_uikit: ^6.0.4
```

### 5. State Management Migration (Advanced)
Expand Down Expand Up @@ -140,9 +130,9 @@

| Name | Type | Description |
|---|---|---|
| conversationsBloc | ConversationsBloc? | Provide a custom BLoC instance |

Check warning on line 133 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L133

Did you really mean 'conversationsBloc'?
| routeObserver | RouteObserver? | Freeze rebuilds during navigation |

Check warning on line 134 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L134

Did you really mean 'routeObserver'?
| hideSearch | bool? | Hide the search bar |

Check warning on line 135 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L135

Did you really mean 'hideSearch'?
| searchReadOnly | bool? | Make search bar read-only |
| onSearchTap | VoidCallback? | Callback when search is tapped |

Expand All @@ -153,11 +143,11 @@
| theme | Replaced by ThemeData extensions |
| errorStateText, emptyStateText, loadingStateText | Use custom state views instead |
| stateCallBack | Use BLoC events instead |
| avatarStyle, statusIndicatorStyle, badgeStyle, receiptStyle, dateStyle | Consolidated into CometChatConversationsStyle |

Check warning on line 146 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L146

Did you really mean 'avatarStyle'?

Check warning on line 146 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L146

Did you really mean 'badgeStyle'?

Check warning on line 146 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L146

Did you really mean 'receiptStyle'?

Check warning on line 146 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L146

Did you really mean 'dateStyle'?
| hideSeparator | Controlled via style |

Check warning on line 147 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L147

Did you really mean 'hideSeparator'?
| disableTyping | Handled internally |

Check warning on line 148 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L148

Did you really mean 'disableTyping'?
| deleteConversationDialogStyle | Integrated into main style |
| disableMentions | Handled via text formatters |

Check warning on line 150 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L150

Did you really mean 'disableMentions'?

Check warning on line 150 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L150

Did you really mean 'formatters'?

### Message List

Expand All @@ -168,7 +158,7 @@
| messageListBloc | MessageListBloc? | Provide a custom BLoC instance |
| enableConversationStarters | bool | Enable AI conversation starters |
| enableSmartReplies | bool | Enable AI smart replies |
| addTemplate | List&lt;CometChatMessageTemplate&gt;? | Add custom templates to existing ones |

Check warning on line 161 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L161

Did you really mean 'addTemplate'?
| hideModerationView | bool | Hide moderation view |

#### Removed Properties (from V5)
Expand All @@ -177,9 +167,9 @@
|---|---|
| theme | Replaced by ThemeData extensions |
| scrollToBottomOnNewMessages | Handled internally |
| timestampAlignment | Controlled via style |

Check warning on line 170 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L170

Did you really mean 'timestampAlignment'?
| messageInformationConfiguration | Handled via BLoC |
| reactionListConfiguration, reactionsConfiguration | Simplified |

Check warning on line 172 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L172

Did you really mean 'reactionsConfiguration'?

### Message Composer

Expand Down Expand Up @@ -214,7 +204,7 @@

| Name | Type | Description |
|---|---|---|
| titleView | Widget? Function(Group?, User?, BuildContext)? | Custom title widget |

Check warning on line 207 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L207

Did you really mean 'titleView'?
| leadingStateView | Widget? Function(Group?, User?, BuildContext)? | Custom leading widget |
| auxiliaryButtonView | Widget? Function(Group?, User?, BuildContext)? | Custom auxiliary button |
| hideVideoCallButton | bool? | Hide video call button |
Expand All @@ -225,9 +215,9 @@
| Name | Description |
|---|---|
| theme | Replaced by ThemeData extensions |
| avatarStyle, statusIndicatorStyle | Consolidated into CometChatMessageHeaderStyle |

Check warning on line 218 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L218

Did you really mean 'avatarStyle'?
| privateGroupIcon, protectedGroupIcon | Handled via style |
| disableTyping | Handled internally |

Check warning on line 220 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L220

Did you really mean 'disableTyping'?

### Users

Expand All @@ -235,19 +225,19 @@

| Name | Type | Description |
|---|---|---|
| usersBloc | UsersBloc? | Provide a custom BLoC instance |

Check warning on line 228 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L228

Did you really mean 'usersBloc'?
| setOptions | Function? | Set long press actions |

Check warning on line 229 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L229

Did you really mean 'setOptions'?
| addOptions | Function? | Add to long press actions |

Check warning on line 230 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L230

Did you really mean 'addOptions'?
| trailingView | Widget? Function(BuildContext, User)? | Custom trailing widget |

Check warning on line 231 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L231

Did you really mean 'trailingView'?
| leadingView | Widget? Function(BuildContext, User)? | Custom leading widget |

Check warning on line 232 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L232

Did you really mean 'leadingView'?
| titleView | Widget? Function(BuildContext, User)? | Custom title widget |

Check warning on line 233 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L233

Did you really mean 'titleView'?

#### Removed Properties (from V5)

| Name | Description |
|---|---|
| theme | Replaced by ThemeData extensions |
| listItemStyle, avatarStyle, statusIndicatorStyle | Consolidated into CometChatUsersStyle |

Check warning on line 240 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L240

Did you really mean 'avatarStyle'?
| options | Replaced by setOptions/addOptions |

### Groups
Expand All @@ -256,20 +246,20 @@

| Name | Type | Description |
|---|---|---|
| groupsBloc | GroupsBloc? | Provide a custom BLoC instance |

Check warning on line 249 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L249

Did you really mean 'groupsBloc'?
| groupTypeVisibility | bool | Hide group type icon |
| setOptions | Function? | Set long press actions |

Check warning on line 251 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L251

Did you really mean 'setOptions'?
| addOptions | Function? | Add to long press actions |

Check warning on line 252 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L252

Did you really mean 'addOptions'?
| trailingView | Widget? Function(BuildContext, Group)? | Custom trailing widget |

Check warning on line 253 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L253

Did you really mean 'trailingView'?
| leadingView | Widget? Function(BuildContext, Group)? | Custom leading widget |

Check warning on line 254 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L254

Did you really mean 'leadingView'?
| titleView | Widget? Function(BuildContext, Group)? | Custom title widget |

Check warning on line 255 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L255

Did you really mean 'titleView'?

#### Removed Properties (from V5)

| Name | Description |
|---|---|
| theme | Replaced by ThemeData extensions |
| listItemStyle, avatarStyle, statusIndicatorStyle | Consolidated into CometChatGroupsStyle |

Check warning on line 262 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L262

Did you really mean 'avatarStyle'?
| options | Replaced by setOptions/addOptions |

### Group Members
Expand All @@ -287,6 +277,6 @@

| V5 Name | V6 Name | Description |
|---|---|---|
| tailView | trailingView | Custom trailing widget |

Check warning on line 280 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L280

Did you really mean 'tailView'?

Check warning on line 280 in ui-kit/flutter/upgrading-from-v5.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/flutter/upgrading-from-v5.mdx#L280

Did you really mean 'trailingView'?
| disableUsersPresence | usersStatusVisibility | Inverted logic |
| groupMemberStyle | style | Type changed to CometChatGroupMembersStyle |