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 a single chatroom

  1. Create an object of the GetChatroomRequest class.
  2. For creating a post call getChatroom() present in LMChatClient class using your request object.
  3. Process the response (LMResponse<GetChatroomResponse>) as per your requirement.
GetChatroomRequest request = GetChatroomRequestBuilder(chatroomId: 70989).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);
}

Models

GetChatroomRequest

List of parameters for the GetChatroomRequest class

VariableTypeDescriptionOptional
chatroomIdintChatroom Id
pageint?Page number for API response✔️
pageSizeint?Page size for API response✔️

GetChatroomResponse

List of parameters for the GetChatroomResponse class

VariableTypeDescriptionOptional
successboolAPI success status
chatroomChatRoom?Chatroom data object✔️
errorMessageString?Error log incase the API fails✔️
participantCountint?Total no of users in a chatroom✔️
conversationUsersList<User>?List of users in a chatroom✔️
chatroomActionsList<ChatroomAction>?List of actions in a chatroom✔️
communityCommunity?Community object✔️
lastConversationIdint?Last conversation id✔️
unreadMessagesint?Total unread messages in a chatroom✔️
canAccessSecretChatroombool?Can access secret chatroom✔️

ChatRoomMember

List of parameters for the ChatRoomMember class

VariableTypeDescriptionOptional
customIntroTextString?Custom intro text✔️
customTitleString?Custom title✔️
idintUser id
imageUrlString?User image url✔️
isGuestbool?Is guest user✔️
isOwnerbool?Is owner of the chatroom✔️
memberSinceString?Member since✔️
memberSinceEpochint?Member since epoch✔️
nameStringUser name
organisationNameString?Organisation name✔️
routeString?Route✔️
stateintState
updatedAtint?Updated at✔️
userUniqueIdString?User unique id✔️