Chat / Flutter
Chat Flutter v3
Chat Flutter
Chat
Flutter
Version 3
Home
/
Chat
/
Flutter
/
Message

List replies in a message thread

You can retrieve replies to a message by identifying the parent message like the following. First, create a ThreadMessageListParams object and set properties related to the thread where the target replies belong to.

final params = ThreadedMessageListParams()
    ..replyType = ReplyType.all
    ..nextResultSize = 10
    ..previousResultSize = 10
    ..includeParentMessageInfo = true
    ..isInclusive = true;
    ..includeThreadInfo = false;

ThreadedMessageListParams

This table only contains properties shown in the code above. To see the comprehensive list of all available methods and properties, see ThreadedMessageListParams.

Property nameTypeDescription

isInclusive

boolean

Determines whether to include messages sent exactly on the specified timestamp or have the matching message ID.

previousResultSize

int

Specifies the number of messages to retrieve, which are sent previously before a specified timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the earliest message.

nextResultSize

int

Specifies the number of messages to retrieve, which are sent later after a specified timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the latest message.

includeParentMessageInfo

boolean

Determines whether to include the information of the parent messages in the result. (Default: false)

replyType

string

Specifies the type of message to include in the results.
- NONE (default): Includes unthreaded messages and only the parent messages of threaded messages.
- ALL: Includes both threaded and unthreaded messages.
- ONLY_REPLY_TO_CHANNEL: Includes unthreaded messages, parent messages of threaded messages, and messages sent to the channel as replies with the reply_to_channel property set to true.

includeThreadInfo

boolean

Determines whether to include the thread information of the messages in the result. (Default: false)

includeReplies

boolean

(Deprecated) Determines whether to include message replies in the result. Use includeParentMessageInfo instead.

includeParentMessageText

boolean

(Deprecated) Determines whether to include the parent message text in the results when the messages are replies in a thread. If the type of the parent message is UserMessage, the value is a message property. If it is FileMessage, the value is the name of the uploaded file. Use replyType instead.

Using the timestamp of the parent message, you can retrieve the parent message with its replies by passing a ThreadedMessageListParams object as an argument to the parameter in the getThreadedMessagesByTimestamp() method.

try {
    final result = await message.getThreadedMessagesByTimestamp(
        TIMESTAMP,
        params
    );
    // The result includes an object that contains a parent message and its replies.
} catch (e) {
    // Handle error.
}

List of parameters

Parameter nameTypeDescription

timestamp

int

Specifies the timestamp to be the reference point of message retrieval in Unix milliseconds format.