fetchChatRoomMembers method
Gets the chat room member list.
Param roomId
The chat room ID.
Param cursor
The cursor position from which to start getting data.
Param pageSize
The number of members per page.
Return The list of chat room members. See ChatCursorResult
. If ChatCursorResult.cursor is an empty string (""), all data is fetched.
Throws A description of the exception. See ChatError.
Implementation
Future<ChatCursorResult<String>> fetchChatRoomMembers(
String roomId, {
String? cursor,
int pageSize = 200,
}) async {
Map req = {"roomId": roomId, "pageSize": pageSize};
req.putIfNotNull("cursor", cursor);
Map result =
await _channel.invokeMethod(ChatMethodKeys.fetchChatRoomMembers, req);
try {
ChatError.hasErrorFromResult(result);
return ChatCursorResult<String>.fromJson(
result[ChatMethodKeys.fetchChatRoomMembers],
dataItemCallback: (obj) => obj);
} on ChatError catch (e) {
throw e;
}
}