Skip to main content

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

  1. Create an object of the GetParticipantsRequest class, using the GetParticipantsRequestBuilder class.
  2. For getting the list of participants in a chatroom call getParticipants() present in LMChatClient class using your request object.
  3. 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

VariableTypeDescriptionOptional
chatroomIdintChatroom Id
pageintPage number
pageSizeintPage size
isSecretboolIs secret chatroom
searchString?Search string✔️

GetParticipantsResponse

List of parameters for the GetParticipantsResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageString?Error message in case of failure✔️
participantsList<User>?List of participants✔️
canEditParticipantbool?Bool to check edit status✔️