addUserToBlockList method

Future<void> addUserToBlockList(
  1. String username
)

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 username The user to be added to the block list.

Throws A description of the exception. See ChatError.

Implementation

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