Skip to main content

Get Chatroom

A chatroom is a place where users can interact with each other.The LikeMinds Flutter Chat SDK supports different types of chatrooms, including:

  • Open chatrooms: Open to all users within the community, allowing for broad participation and discussions.
  • Secret chatrooms: Highly secure and hidden, accessible only to invited members, ensuring utmost privacy and confidentiality.

These diverse chatroom types cater to various communication needs, providing flexibility and control over the conversations within your Flutter chat application. A chatroom can be created by a user or by the community manager.

Steps to fetch Chatrooms

  1. Create an object of the GetChatroomRequest class.
  2. Call the getChatroom() function using the instance of the LMChatClient class.
  3. Process the response LMResponse<GetChatroomResponse> as per your requirement.
GetChatroomRequest request = (GetChatroomRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID")
..page(1)
..pageSize(10))
.build();

LMResponse<GetChatroomResponse> response = await lmChatClient.getChatroom(request);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response.errorMessage);
}

Models

GetChatroomRequest

List of parameters for the GetChatroomRequest class

VariableTypeDescriptionOptional
chatroomIdintUnique ID of the chatroom
pageint?Page number for paginated response✔️
pageSizeint?Page size for paginated response✔️

GetChatroomResponse

List of parameters for the GetChatroomResponse class

VariableTypeDescriptionOptional
canAccessSecretChatroombool?Indicates if the user can access a secret chatroom✔️
chatroomChatRoom?The chatroom object containing chatroom details✔️
chatroomActionsList<ChatroomAction>?List of actions available in the chatroom✔️
communityCommunity?The community object associated with the chatroom✔️
conversationUsersList<User>?List of users participating in the chatroom✔️
lastConversationIdint?ID of the last conversation in the chatroom✔️
participantCountint?Total number of participants in the chatroom✔️
unreadMessagesint?Total number of unread messages in the chatroom✔️