Skip to content
Open
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
13 changes: 13 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4540,6 +4540,19 @@
"sdk/flutter/reactions"
]
},
{
"group": "Offline Support",
"pages": [
"sdk/flutter/offline-overview",
"sdk/flutter/offline-enable",
"sdk/flutter/offline-cached-data",
"sdk/flutter/offline-send",
"sdk/flutter/offline-sync",
"sdk/flutter/offline-media-caching",
"sdk/flutter/offline-encryption",
"sdk/flutter/offline-reference"
]
},
{
"group": "Users",
"pages": [
Expand Down
42 changes: 42 additions & 0 deletions sdk/flutter/additional-message-filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Filter CometChat messages in Flutter apps by limit, message ID, timestamp, user, group, category, type, and other request options."
---

import FlutterOfflineListener from '/snippets/sdk/flutter-offline-listener.mdx';



The `MessagesRequest` class as you must be familiar with helps you to fetch messages based on the various parameters provided to it. This document will help you understand better the various options that are available using the `MessagesRequest` class.
Expand Down Expand Up @@ -37,7 +39,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 42 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L42

Did you really mean 'messageRequest'?
..uid = UID
..limit = 30).build();
```
Expand Down Expand Up @@ -77,7 +79,7 @@
<Tab title="Dart">
```dart
String UID = "cometchat-uid-1";
MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 82 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L82

Did you really mean 'messageRequest'?
..uid = UID
..limit = 50).build();
```
Expand All @@ -96,7 +98,7 @@
<Tab title="Dart">
```dart
String GUID = "cometchat-uid-1";
MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 101 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L101

Did you really mean 'messageRequest'?
..guid = GUID
..limit = 50).build();
```
Expand All @@ -109,14 +111,14 @@

*In other words, how do I fetch messages before or after a particular message*

This can be achieved using the `messageId` parameter. This method takes the messageId as input and provides messages only after/before the message-id based on if the fetchNext() or fetchPrevious() method is triggered.

Check warning on line 114 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L114

Did you really mean 'messageId'?

<Tabs>
<Tab title="Dart">
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 121 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L121

Did you really mean 'messageRequest'?
..uid = UID
..messageId = 50
..limit = 50).build();
Expand Down Expand Up @@ -162,7 +164,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 167 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L167

Did you really mean 'messageRequest'?
..uid = UID
..unread = true
..limit = 50).build();
Expand Down Expand Up @@ -208,7 +210,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 213 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L213

Did you really mean 'messageRequest'?
..uid = UID
..updatedAfter = DateTime.now()
..limit = 50).build();
Expand All @@ -222,6 +224,8 @@

## Updated messages only

<Note>With offline support on, this filter is answered by the server only; the cached page is empty.</Note>

*In other words, how do I fetch messages that have been updated after a particular date or time*

This can be achieved easily by setting the updatesOnly parameter to true. To do so, you can use the updatesOnly() method. This method takes a boolean input and can be used with the `updatedAfter` parameter to get just the updated messages and not the messages sent/received after the specified time. This method cannot be used independently and always needs to be used with the `updatedAfter` parameter.
Expand Down Expand Up @@ -258,7 +262,7 @@
categories.add("message");
categories.add("custom");

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 265 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L265

Did you really mean 'messageRequest'?
..uid = UID
..categories = categories
..limit = 50).build();
Expand Down Expand Up @@ -309,7 +313,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 316 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L316

Did you really mean 'messageRequest'?
..uid = UID
..parentMessageId = 103
..limit = 50).build();
Expand Down Expand Up @@ -346,14 +350,14 @@

*In other words, how do I exclude deleted messages a user/group conversations*

In order to do this, you can use the hideDeleted parameter. This parameter takes boolean as input. If set to true, it will make sure that the deleted messages are not fetched. If set to false, which is also the default value, the deleted messages will also be fetched along with other messages.

Check warning on line 353 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L353

Did you really mean 'hideDeleted'?

<Tabs>
<Tab title="Dart">
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 360 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L360

Did you really mean 'messageRequest'?
..uid = UID
..hideDeleted = true
..limit = 50).build();
Expand Down Expand Up @@ -398,7 +402,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 405 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L405

Did you really mean 'messageRequest'?
..uid = UID
...withTags = true
..limit = 50).build();
Expand All @@ -410,6 +414,8 @@

## Messages with links

<Note>With offline support on, this filter is answered by the server only; the cached page is empty.</Note>

In other words, as a logged-in user, how do I fetch messages that contains links?

In order to do this, you can use the `hasLinks` parameter. This parameter accepts boolean as input. When set to `true` , the SDK will fetch messages which have links in the text. The default value for this parameter is `false`.
Expand Down Expand Up @@ -452,7 +458,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 461 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L461

Did you really mean 'messageRequest'?
..uid = UID
..hasAttachments = true
..limit = 50).build();
Expand Down Expand Up @@ -506,7 +512,7 @@
```dart
String UID = "cometchat-uid-1";

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 515 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L515

Did you really mean 'messageRequest'?
..uid = UID
..hasMentions = true
..limit = 50).build();
Expand Down Expand Up @@ -555,11 +561,11 @@
<Tab title="Dart">
```dart
String UID = "cometchat-uid-1";
List<String> attachmentTypes = [];

Check warning on line 564 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L564

Did you really mean 'attachmentTypes'?
attachmentTypes.add("image");
attachmentTypes.add("video");

MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 568 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L568

Did you really mean 'messageRequest'?
..uid = UID
..attachmentTypes = attachmentTypes
..limit = 50).build();
Expand Down Expand Up @@ -602,10 +608,12 @@

*Available since v5.0.7.* Set the `pinned` parameter to `true` to fetch only the pinned messages of a conversation. A pinned list is conversation-scoped, so pair it with `uid` or `guid` — exactly one of the two. The list is ordered by pin time, most recently pinned first.

<Note>With offline support on, the pinned list is served from the cache first, then from the server. See [Pin A Message](/sdk/flutter/pin-message).</Note>

<Tabs>
<Tab title="Dart">
```dart
MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 616 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L616

Did you really mean 'messageRequest'?
..guid = "cometchat-guid-1"
..pinned = true
..limit = 50).build();
Expand All @@ -621,10 +629,12 @@

*Available since v5.0.7.* Set the `saved` parameter to `true` to fetch the logged-in user's saved messages. Saves span every conversation, so leave `uid` and `guid` unset. The list is ordered by save time, most recently saved first.

<Note>With offline support on, the saved list is served from the cache first, then from the server. See [Save A Message](/sdk/flutter/save-message).</Note>

<Tabs>
<Tab title="Dart">
```dart
MessagesRequest messageRequest = (MessagesRequestBuilder()

Check warning on line 637 in sdk/flutter/additional-message-filtering.mdx

View check run for this annotation

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

sdk/flutter/additional-message-filtering.mdx#L637

Did you really mean 'messageRequest'?
..saved = true
..limit = 50).build();
```
Expand All @@ -634,3 +644,35 @@
</Tabs>

See [Save A Message](/sdk/flutter/save-message) for saving, the `savedAt` field, and real-time save events.

## Offline Behaviour

<FlutterOfflineListener method="`fetchPrevious()` / `fetchNext()`" listener="`MessageFetchListener`" />

With offline support enabled, `fetchPrevious`/`fetchNext` answer from the on-device cache first (`onCachedMessages`, even when empty) and then from the server (`onServerMessages`). The cache answers a page **only when every filter on the request is locally computable** — a single server-only filter makes the cached page empty with no error, while the server phase still answers in full. Offline, the fetch ends with `onError` (code `ERR_CONNECTION`, details `ERROR_INTERNET_UNAVAILABLE`) after the cached page. See [Show Cached Data](/sdk/flutter/offline-cached-data).

| Builder method | Offline behaviour |
| --- | --- |
| `setUnread(bool)` | Cached |
| `setHideMessagesFromBlockedUsers(bool)` | Cached |
| `setUpdatesOnly(bool)` | Server only — cached page is empty |
| `setCategories(List)` | Cached |
| `setTypes(List)` | Cached |
| `setParentMessageId(int)` | Cached |
| `setHideReplies(bool)` | Cached |
| `hideDeletedMessages(bool)` | Cached |
| `setHideQuotedMessages(bool)` | Cached |
| `setTags(List)` | Cached |
| `setWithTags(bool)` | Cached |
| `setHasLinks(bool)` | Server only — cached page is empty |
| `setSearchKeyword(String)` | Server only — cached page is empty |
| `setInteractionGoalCompletedOnly(bool)` | Server only — cached page is empty |
| `setHasAttachments(bool)` | Cached |
| `setHasReactions(bool)` | Cached |
| `setAttachmentTypes(List)` | Cached |
| `setHasMentions(bool)` | Cached |
| `setMentionedUIDs(List)` | Cached |
| `setPinned(bool)` | Cached |
| `setSaved(bool)` | Cached |

`setPinned`/`setSaved` are served from the separate pinned and saved stores, not the message cache — the other filters in this table are not applied to a pinned or saved read. `setMessageId`, `setTimestamp`, `setUpdatedAfter`, `setLimit`, `setUID` and `setGUID` are scope and pagination inputs, not filters, and do not change what the cache can answer.
10 changes: 9 additions & 1 deletion sdk/flutter/ai-moderation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Automatically review CometChat messages for inappropriate content in Flutter apps using AI moderation rules and message status updates."
---

import FlutterOfflineSend from '/snippets/sdk/flutter-offline-send.mdx';

<Accordion title="AI Integration Quick Reference">

| Field | Value |
Expand Down Expand Up @@ -45,6 +47,7 @@
participant Moderation

App->>SDK: sendMessage()
SDK-->>App: onMessagePending (with a MessageSentListener, offline support on)
SDK->>CometChat: Send Message
CometChat->>Moderation: Process Message
CometChat-->>SDK: Message (status: PENDING)
Expand All @@ -57,7 +60,7 @@
| Step | Description |
|------|-------------|
| 1. Send Message | App sends a text, image, or video message |
| 2. Pending Status | Message is sent with `PENDING` moderation status |
| 2. Pending Status | Message is sent with `PENDING` moderation status. This is separate from the send status: with offline support on and a `MessageSentListener`, `onMessagePending` fires first, before the message reaches the server. |
| 3. AI Processing | Moderation service analyzes the content |
| 4. Result Event | `onMessageModerated` event fires with final status |

Expand Down Expand Up @@ -89,13 +92,15 @@

When you send a text, image, or video message, check the initial moderation status:

<FlutterOfflineSend method="`sendMessage()`" />

<Tabs>
<Tab title="Dart">
```dart
TextMessage textMessage = TextMessage(

Check warning on line 100 in sdk/flutter/ai-moderation.mdx

View check run for this annotation

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

sdk/flutter/ai-moderation.mdx#L100

'textMessage' is repeated!

Check warning on line 100 in sdk/flutter/ai-moderation.mdx

View check run for this annotation

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

sdk/flutter/ai-moderation.mdx#L100

Did you really mean 'textMessage'?
text: "Hello, how are you?",
receiverUid: receiverUID,

Check warning on line 102 in sdk/flutter/ai-moderation.mdx

View check run for this annotation

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

sdk/flutter/ai-moderation.mdx#L102

Did you really mean 'receiverUid'?
receiverType: ReceiverTypeConstants.user,

Check warning on line 103 in sdk/flutter/ai-moderation.mdx

View check run for this annotation

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

sdk/flutter/ai-moderation.mdx#L103

Did you really mean 'receiverType'?
);

CometChat.sendMessage(
Expand All @@ -108,6 +113,9 @@
}
},
onError: (CometChatException e) {
// With offline support on and a MessageSentListener, a message queued offline
// reports ERR_CONNECTION here and sends on reconnect — not a flat failure. Real
// failures arrive in OfflineMessageListener.onOutboxMessageFailed.
print("Message sending failed: ${e.message}");
},
);
Expand Down
4 changes: 4 additions & 0 deletions sdk/flutter/authentication-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

<Note>

We have setup 5 users for testing having UIDs: `cometchat-uid-1`, `cometchat-uid-2`, `cometchat-uid-3`, `cometchat-uid-4` and `cometchat-uid-5`.

Check warning on line 70 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L70

Did you really mean 'UIDs'?

</Note>

Expand All @@ -88,15 +88,15 @@
<Tabs>
<Tab title="Dart">
```dart
String UID = "user_id"; // Replace with the UID of the user to login

Check warning on line 91 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L91

Did you really mean 'user_id'?
String authKey = "AUTH_KEY"; // Replace with your App Auth Key

Check warning on line 92 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L92

Did you really mean 'authKey'?

final user = await CometChat.getLoggedInUser();
if (user == null) {
await CometChat.login(UID, authKey,
onSuccess: (User user) {

Check warning on line 97 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L97

Did you really mean 'onSuccess'?
debugPrint("Login Successful : $user" );
}, onError: (CometChatException e) {

Check warning on line 99 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L99

Did you really mean 'onError'?
debugPrint("Login failed with exception: ${e.message}");
});
}
Expand Down Expand Up @@ -127,7 +127,7 @@
String authToken = "AUTH_TOKEN";
var user = await CometChat.getLoggedInUser(onSuccess: (_){}, onError: (_){});
if (user == null) {
if(authToken!=null){

Check warning on line 130 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L130

Did you really mean 'authToken'?
await CometChat.loginWithAuthToken(authToken,
onSuccess: (User loggedInUser){
debugPrint("Login Successful : $user" );
Expand All @@ -152,12 +152,16 @@

You can use the `logout()` method to log out the user from CometChat. We suggest you call this method once your user has been successfully logged out from your app.

<Note>
With offline support enabled, logging out — or logging in as a different user — wipes the current user's on-device cache (its messages, media and queued messages). See [Stay in Sync](/sdk/flutter/offline-sync).
</Note>

<Tabs>
<Tab title="Dart">
```dart
CometChat.logout( onSuccess: ( successMessage) {

Check warning on line 162 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L162

Did you really mean 'successMessage'?
debugPrint("Logout successful with message $successMessage");
}, onError: (CometChatException e ){

Check warning on line 164 in sdk/flutter/authentication-overview.mdx

View check run for this annotation

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

sdk/flutter/authentication-overview.mdx#L164

Did you really mean 'onError'?
debugPrint("Logout failed with exception: ${e.message}");
}
);
Expand Down
42 changes: 37 additions & 5 deletions sdk/flutter/block-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Block and unblock CometChat users in Flutter apps to stop direct communication and manage blocked user lists."
---

import FlutterOfflineListener from '/snippets/sdk/flutter-offline-listener.mdx';

<Accordion title="AI Integration Quick Reference">

| Field | Value |
Expand Down Expand Up @@ -34,9 +36,9 @@
uids.add("UID1");
uids.add("UID2");
uids.add("UID3");
CometChat.blockUser(uids, onSuccess: (Map<String, dynamic> map) {

Check warning on line 39 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L39

Did you really mean 'onSuccess'?
debugPrint("Blocked User Successfully $map ");
}, onError: (CometChatException e) {

Check warning on line 41 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L41

Did you really mean 'onError'?
debugPrint("Blocked User Unsuccessful ${e.message} ");
});
```
Expand All @@ -61,9 +63,9 @@
uids.add("UID2");
uids.add("UID3");

CometChat.unblockUser(uids, onSuccess: (Map<String, dynamic> map) {

Check warning on line 66 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L66

Did you really mean 'onSuccess'?
debugPrint("Blocked User Successfully $map ");
}, onError: (CometChatException e) {

Check warning on line 68 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L68

Did you really mean 'onError'?
debugPrint("Blocked User Unsuccessful ${e.message} ");
});
```
Expand Down Expand Up @@ -100,14 +102,16 @@

### Set Search Keyword

<Note>With offline support on, the cached page is filtered by this keyword on the device too, as a case-insensitive substring match on the user's name.</Note>

This method allows you to set the search string based on which the blocked users are to be fetched.

<Tabs>
<Tab title="Dart">
```dart
BlockedUsersRequest blockedUsersRequest = (BlockedUsersRequestBuilder()

Check warning on line 112 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L112

'blockedUsersRequest' is repeated!
..limit = 50
..searchKeyword = "abc"

Check warning on line 114 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L114

Did you really mean 'abc'?
).build();
```

Expand All @@ -124,7 +128,7 @@
<Tabs>
<Tab title="Dart">
```dart
BlockedUsersRequest blockedUsersRequest = (BlockedUsersRequestBuilder()

Check warning on line 131 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L131

'blockedUsersRequest' is repeated!
..limit = 50
.direction = CometChatBlockedUsersDirection.directionBlockedByMe
).build();
Expand All @@ -138,20 +142,48 @@

Once you have the object of the `BlockedUsersRequest` class, you need to call the `fetchNext()` method. Calling this method will return a list of `User` objects containing n number of blocked users where N is the limit set in the builder class.

<FlutterOfflineListener method="`fetchNext()`" listener="`BlockedUsersFetchListener`" />

<Tabs>
<Tab title="Dart">
```dart
class Class_Name extends BlockedUsersFetchListener {

Check warning on line 150 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L150

Did you really mean 'Class_Name'?
@override
void onCachedBlockedUsers(List<User> users) {
// Cached page: fires first (even when empty). Render immediately.
debugPrint("Cached blocked users: ${users.length}");
}

@override
void onServerBlockedUsers(List<User> users) {
// Server page: reconcile your displayed list, keyed by uid.
debugPrint("Server blocked users: ${users.length}");
}

@override
void onError(CometChatException e) {
// Handle failure (offline: ERR_CONNECTION after the cached page).
debugPrint("Blocked User Request failed with exception: ${e.message}");
}
}

BlockedUsersRequest blockedUsersRequest = (BlockedUsersRequestBuilder()

Check warning on line 170 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L170

'blockedUsersRequest' is repeated!
..limit = 30
).build();

blockedUsersRequest.fetchNext(onSuccess: (List<User> userList){
debugPrint("Custom Message Sent Successfully : $userList ");
}, onError: (CometChatException e){
debugPrint("Blocked User Request failed with exception: ${e.message}");
});
blockedUsersRequest.fetchNext(onSuccess: null, onError: null, listener: Class_Name());

Check warning on line 174 in sdk/flutter/block-users.mdx

View check run for this annotation

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

sdk/flutter/block-users.mdx#L174

Did you really mean 'onError'?
```

</Tab>

</Tabs>

## Offline Behaviour

With offline support enabled, `BlockedUsersRequest.fetchNext()` with a `BlockedUsersFetchListener` first delivers `onCachedBlockedUsers` from the SDK's own blocked-users list, which it refreshes on login and on reconnect and updates when you call `blockUsers()` or `unblockUsers()`. Then `onServerBlockedUsers` delivers the live page to reconcile by `uid`; the server page is not saved to the device. The cached page is empty when no users are blocked; with `searchKeyword` set, it holds the cached blocked users whose name contains the keyword. Offline, the read ends with `onError` with code `ERR_CONNECTION` (details `ERROR_INTERNET_UNAVAILABLE`) after the cached page. See [Show Cached Data](/sdk/flutter/offline-cached-data).

| Builder option | Offline |
|---|---|
| `limit` | Cached |
| `direction` | Cached |
| `searchKeyword` | Cached (substring match on the name) |
18 changes: 18 additions & 0 deletions sdk/flutter/campaigns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Fetch notification feed items, listen for real-time delivery, mark items as read/delivered, report engagement, and retrieve unread counts in Flutter."
---

import FlutterOfflineListener from '/snippets/sdk/flutter-offline-listener.mdx';

<Accordion title="AI Integration Quick Reference">

| Field | Value |
Expand Down Expand Up @@ -37,7 +39,7 @@
**Design cards visually with [Card Builder](/card-builder/overview).** Build your card messages in the CometChat Dashboard and export the Card Schema JSON — instead of writing it by hand.
</Tip>

- **Type:** `CardMessage` (cometchat_sdk)

Check warning on line 42 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L42

Did you really mean 'cometchat_sdk'?
- **Category:** `"card"` (`CometChatMessageCategory.card`)

### Properties
Expand Down Expand Up @@ -132,12 +134,12 @@
"light": "transparent",
"dark": "transparent"
},
"textColor": {

Check warning on line 137 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L137

Did you really mean 'textColor'?
"light": "#6C5CE7",
"dark": "#6C5CE7"
},
"size": 40,
"fontSize": 13,

Check warning on line 142 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L142

Did you really mean 'fontSize'?
"borderRadius": 6,
"padding": {
"top": 0,
Expand All @@ -155,14 +157,14 @@
"id": "col_98fed9bd-1a95-4cee-aa81-84a9016e41f2"
}
],
"fallbackText": "",

Check warning on line 160 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L160

Did you really mean 'fallbackText'?
"style": {
"background": {
"light": "#E8E8E8",
"dark": "#E8E8E8"
},
"borderRadius": 16,
"borderColor": {

Check warning on line 167 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L167

Did you really mean 'borderColor'?
"light": "#DFE6E9",
"dark": "#DFE6E9"
},
Expand Down Expand Up @@ -205,17 +207,19 @@

### Fetch Items

<FlutterOfflineListener method="`fetchNext()`" listener="`NotificationFeedFetchListener`" />

<Tabs>
<Tab title="Dart">
```dart
request.fetchNext(
onSuccess: (List<NotificationFeedItem> items) {

Check warning on line 216 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L216

Did you really mean 'onSuccess'?
for (final item in items) {
final cardJson = jsonEncode(item.content);
// Pass cardJson to CometChatCardView
}
},
onError: (CometChatException e) {

Check warning on line 222 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L222

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand Down Expand Up @@ -245,6 +249,20 @@

---

## Offline Behaviour

With offline support enabled, `NotificationFeedRequest.fetchNext()` on a `NotificationFeedFetchListener` first delivers `onCachedNotificationFeedItems` from the device (empty when nothing was recorded), then `onServerNotificationFeedItems` with the live page to reconcile by item `id`. Offline, the read ends with `onError` (code `ERR_CONNECTION`, details `ERROR_INTERNET_UNAVAILABLE`) after the cached page. A `fetchNext()` call made while another fetch of the same request is still running ends with `onError` (code `ERROR_REQUEST_IN_PROGRESS`). Once the list has ended, a further `fetchNext()` asks the server again and delivers only items this request has not delivered before. See [Show Cached Data](/sdk/flutter/offline-cached-data).

| Builder method | Offline |
|---|---|
| `setLimit` | Cached |
| `setReadState` | Cached |
| `setCategory` | Cached |
| `setChannelId` | Cached |
| `setTags` | Cached |
| `setDateFrom` | Cached |
| `setDateTo` | Cached |

## Retrieve Notification Categories

Use `NotificationCategoriesRequest` to fetch available categories for filter chips.
Expand All @@ -252,17 +270,17 @@
<Tabs>
<Tab title="Dart">
```dart
final categoriesRequest = (NotificationCategoriesRequestBuilder()

Check warning on line 273 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L273

Did you really mean 'categoriesRequest'?
..setLimit(50))
.build();

categoriesRequest.fetchNext(
onSuccess: (List<NotificationCategory> categories) {

Check warning on line 278 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L278

Did you really mean 'onSuccess'?
for (final category in categories) {
debugPrint("Category: ${category.name}");
}
},
onError: (CometChatException e) {

Check warning on line 283 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L283

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand Down Expand Up @@ -290,7 +308,7 @@
```dart
class MyNotificationFeedListener with NotificationFeedListener {
@override
void onFeedItemReceived(NotificationFeedItem feedItem) {

Check warning on line 311 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L311

Did you really mean 'feedItem'?
debugPrint("New item: ${feedItem.id}");
final cardJson = jsonEncode(feedItem.content);
// Insert at top of feed and render
Expand Down Expand Up @@ -326,10 +344,10 @@
```dart
CometChat.markFeedItemAsRead(
feedItem,
onSuccess: (result) {

Check warning on line 347 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L347

Did you really mean 'onSuccess'?
debugPrint("Marked as read");
},
onError: (CometChatException e) {

Check warning on line 350 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L350

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand All @@ -348,10 +366,10 @@
```dart
CometChat.markFeedItemAsDelivered(
feedItem,
onSuccess: (result) {

Check warning on line 369 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L369

Did you really mean 'onSuccess'?
// Success
},
onError: (CometChatException e) {

Check warning on line 372 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L372

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand All @@ -371,8 +389,8 @@
CometChat.reportFeedEngagement(
feedItem,
"clicked",
onSuccess: (result) {},

Check warning on line 392 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L392

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

Check warning on line 393 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L393

Did you really mean 'onError'?
);
```
</Tab>
Expand All @@ -390,10 +408,10 @@
<Tab title="Dart">
```dart
CometChat.getNotificationFeedUnreadCount(
onSuccess: (int count) {

Check warning on line 411 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L411

Did you really mean 'onSuccess'?
debugPrint("Unread: $count");
},
onError: (CometChatException e) {

Check warning on line 414 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L414

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand All @@ -412,11 +430,11 @@
```dart
CometChat.getNotificationFeedItem(
"item-id-123",
onSuccess: (NotificationFeedItem item) {

Check warning on line 433 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L433

Did you really mean 'onSuccess'?
final cardJson = jsonEncode(item.content);
// Render the card
},
onError: (CometChatException e) {

Check warning on line 437 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L437

Did you really mean 'onError'?
debugPrint("Error: ${e.message}");
},
);
Expand All @@ -437,17 +455,17 @@
<Tabs>
<Tab title="Dart">
```dart
final pushNotification = PushNotification(

Check warning on line 458 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L458

Did you really mean 'pushNotification'?
id: pushPayload['announcementId'],

Check warning on line 459 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L459

Did you really mean 'announcementId'?
announcementId: pushPayload['announcementId'],
campaignId: pushPayload['campaignId'],

Check warning on line 461 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L461

Did you really mean 'campaignId'?
source: "campaign",
);

CometChat.markPushNotificationDelivered(
pushNotification,

Check warning on line 466 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L466

Did you really mean 'pushNotification'?
onSuccess: (result) {},

Check warning on line 467 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L467

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

Check warning on line 468 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L468

Did you really mean 'onError'?
);
```
</Tab>
Expand Down Expand Up @@ -541,12 +559,12 @@

| Action Type | Parameters | Description |
| --- | --- | --- |
| `openUrl` | url, openIn | Open a URL in browser or webview |

Check warning on line 562 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L562

Did you really mean 'openIn'?

Check warning on line 562 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L562

Did you really mean 'webview'?
| `chatWithUser` | uid | Navigate to 1:1 chat |

Check warning on line 563 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L563

Did you really mean 'uid'?
| `chatWithGroup` | guid | Navigate to group chat |

Check warning on line 564 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L564

Did you really mean 'guid'?
| `sendMessage` | text, receiverUid, receiverGuid | Send a text message |

Check warning on line 565 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L565

Did you really mean 'receiverUid'?

Check warning on line 565 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L565

Did you really mean 'receiverGuid'?
| `copyToClipboard` | value | Copy text to clipboard |
| `downloadFile` | url, filename | Download a file |
| `initiateCall` | callType (audio/video), uid, guid | Start a call |

Check warning on line 568 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L568

Did you really mean 'callType'?

Check warning on line 568 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L568

Did you really mean 'uid'?

Check warning on line 568 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L568

Did you really mean 'guid'?
| `apiCall` | url, method, headers, body | Make an HTTP request |
| `customCallback` | callbackId, payload | App-specific logic |

Check warning on line 570 in sdk/flutter/campaigns.mdx

View check run for this annotation

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

sdk/flutter/campaigns.mdx#L570

Did you really mean 'callbackId'?
4 changes: 4 additions & 0 deletions sdk/flutter/connection-status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@

CometChat SDK provides you with a mechanism to get real-time status of the connection to CometChat web-socket servers. To achieve this you need to use the `ConnectionListener` class provided by the CometChat SDK

<Note>
With offline support enabled, your app keeps working without a connection: cached chats are shown instantly, and messages you send with a `MessageSentListener` are queued and delivered automatically on reconnect. See [Show Cached Data](/sdk/flutter/offline-cached-data) and [Send While Offline](/sdk/flutter/offline-send).
</Note>

Connection Status provides you with the below 3 methods to get the status of the connection to CometChat web-socket servers:

| Delegate Method | Information |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| onConnecting | This method is triggered when CometChat SDK is trying to establish a connection to the web-socket server. |

Check warning on line 35 in sdk/flutter/connection-status.mdx

View check run for this annotation

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

sdk/flutter/connection-status.mdx#L35

Did you really mean 'onConnecting'?
| onConnected | This method is called when CometChat SDK has successfully established a connection and now is connected. |

Check warning on line 36 in sdk/flutter/connection-status.mdx

View check run for this annotation

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

sdk/flutter/connection-status.mdx#L36

Did you really mean 'onConnected'?
| onDisconnected | This method is called when the CometChat SDK gets disconnected due to any issue while maintaining the connection like network fluctuations, etc. |

Check warning on line 37 in sdk/flutter/connection-status.mdx

View check run for this annotation

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

sdk/flutter/connection-status.mdx#L37

Did you really mean 'onDisconnected'?
| onFeatureThrottled | CometChat automatically toggles off certain features to prevent performance loss for end-users under various circumstances |
| onConnectionError | This method is called when the CometChat SDK gets error due to any issue while maintaining the connection like network fluctuations, etc. |

Expand All @@ -43,7 +47,7 @@
<Tabs>
<Tab title="Dart">
```dart
class Class_Name with ConnectionListener {

Check warning on line 50 in sdk/flutter/connection-status.mdx

View check run for this annotation

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

sdk/flutter/connection-status.mdx#L50

Did you really mean 'Class_Name'?
//1. Register Connection listener
//CometChat.addConnectionListener("listenerId", this);

Expand Down Expand Up @@ -97,7 +101,7 @@
1. `CometChatWSState.connected` (connected);
2. `CometChatWSState.connecting`(connecting)
3. `CometChatWSState.disconnected`(disconnected)
4. `CometChatWSState.featureThrottled`(featureThrottled)

Check warning on line 104 in sdk/flutter/connection-status.mdx

View check run for this annotation

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

sdk/flutter/connection-status.mdx#L104

Did you really mean 'featureThrottled'?

<Note>

Expand Down
4 changes: 4 additions & 0 deletions sdk/flutter/delete-conversation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@

This method takes two parameters. The unique id (UID/GUID) of the conversation to be deleted & the type (user/group) of conversation to be deleted.

<Note>
Deleting a conversation needs a connection — with offline support enabled, `deleteConversation()` is **not** queued for later. On success the conversation and its cached messages are removed from the on-device cache. See [Send While Offline](/sdk/flutter/offline-send).
</Note>

<Tabs>
<Tab title="Delete User Conversation">
```dart
String conversationWith = "UID";

Check warning on line 35 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L35

Did you really mean 'conversationWith'?
String conversationType = CometChatConversationType.user;

Check warning on line 36 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L36

Did you really mean 'conversationType'?
await CometChat.deleteConversation(conversationWith, conversationType,

Check warning on line 37 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L37

Did you really mean 'conversationType'?
onSuccess: (String str){

Check warning on line 38 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L38

Did you really mean 'onSuccess'?
debugPrint("Conversation deleted successfully at : $str");
},
onError: (CometChatException e){

Check warning on line 41 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L41

Did you really mean 'onError'?
debugPrint("Conversation deletion failed : ${e.message}");
}
);
Expand All @@ -44,13 +48,13 @@

<Tab title="Delete Group Conversation">
```dart
String conversationWith = "GUID";

Check warning on line 51 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L51

Did you really mean 'conversationWith'?
String conversationType = CometChatConversationType.group;

Check warning on line 52 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L52

Did you really mean 'conversationType'?
await CometChat.deleteConversation(conversationWith, conversationType,

Check warning on line 53 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L53

Did you really mean 'conversationType'?
onSuccess: (String str){

Check warning on line 54 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L54

Did you really mean 'onSuccess'?
debugPrint("Conversation deleted successfully at : $str");
},
onError: (CometChatException e){

Check warning on line 57 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L57

Did you really mean 'onError'?
debugPrint("Conversation deletion failed : ${e.message}");
}
);
Expand All @@ -66,5 +70,5 @@

| Parameter | Description | Required |
| ---------------- | --------------------------------------------------------------------------------- | -------- |
| conversationWith | `UID` of the user or `GUID` of the group whose conversation you want to delete. | YES |

Check warning on line 73 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L73

Did you really mean 'conversationWith'?
| conversationType | The type of conversation you want to delete . It can be either `user` or `group`. | YES |

Check warning on line 74 in sdk/flutter/delete-conversation.mdx

View check run for this annotation

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

sdk/flutter/delete-conversation.mdx#L74

Did you really mean 'conversationType'?
4 changes: 4 additions & 0 deletions sdk/flutter/delete-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@

To delete a group you need to use the `deleteGroup()` method. The user must be an **Admin** of the group they are trying to delete.

<Note>
Deleting a group needs a connection — with offline support enabled, `deleteGroup()` is **not** queued for later. After it succeeds, the group's conversation and cached messages are removed from the on-device cache when the group-deleted event arrives or at the next reconnect sync; any messages still queued to it are then reported as failed with reason `discarded`. See [Send While Offline](/sdk/flutter/offline-send).
</Note>

<Tabs>
<Tab title="Dart">
```dart
String GUID = "GUID";

CometChat.deleteGroup(GUID, onSuccess: (String message) {

Check warning on line 37 in sdk/flutter/delete-group.mdx

View check run for this annotation

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

sdk/flutter/delete-group.mdx#L37

Did you really mean 'onSuccess'?
debugPrint("Deleted Group Successfully : $message ");
}, onError: (CometChatException e) {

Check warning on line 39 in sdk/flutter/delete-group.mdx

View check run for this annotation

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

sdk/flutter/delete-group.mdx#L39

Did you really mean 'onError'?
debugPrint("Delete Group failed with exception: ${e.message}");
});
```
Expand Down
4 changes: 4 additions & 0 deletions sdk/flutter/delete-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@

In case you have to delete a message, you can use the `deleteMessage()` method. This method takes the message ID of the message to be deleted.

<Note>
Deleting a message needs a connection — with offline support enabled, `deleteMessage()` is **not** queued for later. After `onSuccess`, the deletion is applied to the message in the on-device cache if it is already cached; it never adds a new message. See [Send While Offline](/sdk/flutter/offline-send).
</Note>

<Tabs>
<Tab title="Delete Message">
```dart
int messageId=1234;

await CometChat.deleteMessage(messageId,
onSuccess: (BaseMessage message){

Check warning on line 46 in sdk/flutter/delete-message.mdx

View check run for this annotation

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

sdk/flutter/delete-message.mdx#L46

Did you really mean 'onSuccess'?
debugPrint("Message deleted successfully at : $message");
}, onError: (CometChatException e){

Check warning on line 48 in sdk/flutter/delete-message.mdx

View check run for this annotation

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

sdk/flutter/delete-message.mdx#L48

Did you really mean 'onError'?
debugPrint("Message deletion failed : ${e.message}");
}
);
Expand Down
4 changes: 4 additions & 0 deletions sdk/flutter/edit-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

In order to edit a message, you can use the `editMessage()` method. This method takes an object of the `BaseMessage` class. At the moment, you are only allowed to edit `TextMessage` and `CustomMessage`. Thus, the `BaseMessage` object must either be a Text or a Custom Message.

<Note>
Editing a message needs a connection — with offline support enabled, `editMessage()` is **not** queued for later. After `onSuccess`, the edit is applied to the message in the on-device cache if it is already cached; it never adds a new message. See [Send While Offline](/sdk/flutter/offline-send).
</Note>

### Add/Update Tags

While editing a message, you can update the tags associated with the Message. You can use the `setTags()` method to do so. The tags added while editing a message will replace the tags set when the message was sent.
Expand All @@ -54,18 +58,18 @@
<Tabs>
<Tab title="Dart">
```dart
TextMessage updatedMessage = TextMessage(

Check warning on line 61 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L61

Did you really mean 'updatedMessage'?
text: updatedText,

Check warning on line 62 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L62

Did you really mean 'updatedText'?
receiverUid: receiverID,

Check warning on line 63 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L63

Did you really mean 'receiverUid'?
receiverType: receiverType,

Check warning on line 64 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L64

Did you really mean 'receiverType'?

Check warning on line 64 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L64

Did you really mean 'receiverType'?
type: type);

updatedMessage.id = message.id;

await CometChat.editMessage(updatedMessage,
onSuccess: (BaseMessage message){

Check warning on line 70 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L70

Did you really mean 'onSuccess'?
debugPrint("Message Edited successfully: $message");
}, onError: (CometChatException e){

Check warning on line 72 in sdk/flutter/edit-message.mdx

View check run for this annotation

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

sdk/flutter/edit-message.mdx#L72

Did you really mean 'onError'?
debugPrint("Message Edited failed with exception: ${e.message}");
}
);
Expand Down
Loading
Loading