fetchMemberListFromServer method
Gets the list of group members from the server with pagination.
Param groupId The group ID.
Param pageSize The number of members expected to be returned per page.
Param cursor The cursor for pagination, pass null for the first call.
Returns The member list and cursor for next page.
Throws Exception description, see ChatError.
Implementation
Future<ChatCursorResult<String>> fetchMemberListFromServer(
String groupId, {
int pageSize = 200,
String? cursor,
}) async {
try {
Map req = {
'groupId': groupId,
'pageSize': pageSize,
};
req.putIfNotNull("cursor", cursor);
Map result = await platform_interface.Client.instance.groupManager.callNativeMethod(
ChatMethodKeys.getGroupMemberListFromServer,
req,
);
ChatError.hasErrorFromResult(result);
return ChatCursorResult<String>.fromJson(
result[ChatMethodKeys.getGroupMemberListFromServer],
dataItemCallback: (value) => value);
} catch (e) {
rethrow;
}
}