addUserToBlockList method

Future<void> addUserToBlockList(
  1. String userId
)

Adds a user to the block list. You can send messages to the users on the block list, but cannot receive messages from them.

Param userId The user to be added to the block list.

Throws A description of the exception. See ChatError.

Implementation

Future<void> addUserToBlockList(String userId) async {
  Map req = {'username': userId};
  Map result = await _channel.invokeMethod(
    ChatMethodKeys.addUserToBlockList,
    req,
  );
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}