Get Participants
To retrieve the list of participants in a chatroom, LikeMinds Flutter Chat SDK provides this feature. It enables you to retrieve user details, such as usernames or profile information, for better engagement and interaction within the chatroom.
Steps to Get the List of Participants in a Chatroom
- Create an object of the
GetParticipantsRequest
class, using theGetParticipantsRequestBuilder
class. - For getting the list of participants in a chatroom call
getParticipants()
present inLMChatClient
class using your request object. - Process the response (
LMResponse<GetParticipantsResponse>
) as per your requirement.
GetParticipantsRequest request = (GetParticipantsRequestBuilder()..chatroomId(70989))
.build();
LMResponse<GetParticipantsResponse> response =
await lmChatClient.getParticipants(request);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Models
GetParticipantsRequest
List of parameters for the GetParticipantsRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | int | Chatroom Id | |
page | int | Page number | |
pageSize | int | Page size | |
isSecret | bool | Is secret chatroom | |
search | String? | Search string | ✔️ |
GetParticipantsResponse
List of parameters for the GetParticipantsResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String? | Error message in case of failure | ✔️ |
participants | List<User>? | List of participants | ✔️ |
canEditParticipant | bool? | Bool to check edit status | ✔️ |