Get All Members
The getAllMembers method is used to retrieve a list of members based on their state. This function supports pagination and provides detailed member data.
Steps to Get All Members
- Create a
GetAllMembersRequestobject with the required member state and optional pagination details. - Call the
getAllMembers()function using the instance of theLMChatClientclass. - Use the response LMResponse<
GetAllMembersResponse> to handle the retrieved member list.
GetAllMembersRequest request = (GetAllMembersRequestBuilder()
..memberState(1) // Provide the member state
..page(1)) // Optional: Provide the page number for pagination
.build();
final LMResponse<GetAllMembersResponse> response = await lmChatClient.getAllMembers(request);
if (response.success) {
// Use the retrieved member data
handleMembers(response.data.members);
} else {
// Handle error
handleError(response);
}
tip
The memberState parameter determines the type of members to retrieve. For example, active, inactive, or specific states as defined in your application.
Models
GetAllMembersRequest
List of parameters for the GetAllMembersRequest class:
| Variable | Type | Description | Optional |
|---|---|---|---|
memberState | int | State of members to retrieve | |
page | int | Page number for pagination | ✔️ |
GetAllMembersResponse
List of parameters for the GetAllMembersResponse class:
| Variable | Type | Description | Optional |
|---|---|---|---|
members | List<DmAllMember> | List of members retrieved | ✔️ |
DmAllMember
List of parameters for the DmAllMember class:
| Variable | Type | Description | Optional |
|---|---|---|---|
customTitle | String | Custom title assigned to the member | ✔️ |
id | int | Unique identifier for the member | ✔️ |
imageUrl | String | URL of the member's profile image | ✔️ |
isDeleted | bool | Indicates if the member is deleted | ✔️ |
isGuest | bool | Indicates if the member is a guest | ✔️ |
name | String | Name of the member | ✔️ |
questionAnswers | String | Answers to any custom questions | ✔️ |
sdkClientInfo | SDKClientInfo | SDK client information | ✔️ |
userUniqueId | String | Unique user ID | ✔️ |
uuid | String | Universally unique identifier for member | ✔️ |