blockChatRoomMembers method Null safety

Future<void> blockChatRoomMembers(
  1. String roomId,
  2. List members
)

Adds the specified members to the block list of the chat room.

Only the chat room owner or admin can call this method.

Note

  • Chat room members added to the block list are removed from the chat room by the server, and cannot re-join the chat room.
  • The removed members receive the {@link EMChatRoomEventListener#onRemovedFromChatRoom(String, String?, String)} callback.

Param roomId The chat room ID.

Param members The list of members to be added to block list.

Throws A description of the exception. See {@link EMError}.

Implementation

Future<void> blockChatRoomMembers(
  String roomId,
  List members,
) async {
  Map req = {"roomId": roomId, "members": members};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.blockChatRoomMembers, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}