Post Conversation
LikeMinds Flutter Chat SDK allows you to conveniently post a conversation in an existing chatroom by specifying the chatroom ID. This powerful feature enables you to contribute to ongoing discussions, share important information, or engage with other participants in real-time.
Steps to Post a Conversation
- Create an object of the
PostConversationRequest
class using thePostConversationRequestBuilder
class and specify the chatroom ID and text. - Call
postConversation()
present in theLMChatClient
class using your request object. - Process the response LMResponse<
PostConversationResponse
> as per your requirement.
PostConversationRequest request = (PostConversationRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID")
..text("ENTER_TEXT")
..expiryTime(0))
.build();
LMResponse<PostConversationResponse> response = await lmChatClient.postConversation(request);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Models
PostConversationRequest
List of parameters for the PostConversationRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | int | Chatroom Id | |
text | String | Text to be posted | |
replyId | int? | ID of the conversation to which the reply is being posted | ✔️ |
temporaryId | String | Temporary ID of the conversation | |
hasFiles | bool | Whether the conversation has files | |
attachments | List<Attachment>? | List of attachments in the conversation | ✔️ |
ogTags | OgTags? | Open Graph tags for the conversation | ✔️ |
shareLink | String? | A link to be shared with the conversation | ✔️ |
triggerBot | bool? | Whether to trigger a bot after posting the conversation | ✔️ |
PostConversationResponse
List of parameters for the PostConversationResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
conversation | Conversation? | Conversation object | ✔️ |
id | int? | The ID of the posted conversation | ✔️ |