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
- Create an object of the
GetChatroomRequest
class. - For creating a post call
getChatroom()
present inLMChatClient
class using your request object. - 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
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | int | Chatroom Id | |
page | int? | Page number for API response | ✔️ |
pageSize | int? | Page size for API response | ✔️ |
GetChatroomResponse
List of parameters for the GetChatroomResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
chatroom | ChatRoom? | Chatroom data object | ✔️ |
errorMessage | String? | Error log incase the API fails | ✔️ |
participantCount | int? | Total no of users in a chatroom | ✔️ |
conversationUsers | List<User>? | List of users in a chatroom | ✔️ |
chatroomActions | List<ChatroomAction>? | List of actions in a chatroom | ✔️ |
community | Community? | Community object | ✔️ |
lastConversationId | int? | Last conversation id | ✔️ |
unreadMessages | int? | Total unread messages in a chatroom | ✔️ |
canAccessSecretChatroom | bool? | Can access secret chatroom | ✔️ |
ChatRoomMember
List of parameters for the ChatRoomMember
class
Variable | Type | Description | Optional |
---|---|---|---|
customIntroText | String? | Custom intro text | ✔️ |
customTitle | String? | Custom title | ✔️ |
id | int | User id | |
imageUrl | String? | User image url | ✔️ |
isGuest | bool? | Is guest user | ✔️ |
isOwner | bool? | Is owner of the chatroom | ✔️ |
memberSince | String? | Member since | ✔️ |
memberSinceEpoch | int? | Member since epoch | ✔️ |
name | String | User name | |
organisationName | String? | Organisation name | ✔️ |
route | String? | Route | ✔️ |
state | int | State | |
updatedAt | int? | Updated at | ✔️ |
userUniqueId | String? | User unique id | ✔️ |