changeOwner method

Future<void> changeOwner(
  1. String roomId,
  2. String newOwner
)

Transfers the chat room ownership.

Only the chat room owner can call this method.

Param roomId The chat room ID.

Param newOwner The ID of the new chat room owner.

Throws A description of the exception. See ChatError.

Implementation

Future<void> changeOwner(
  String roomId,
  String newOwner,
) async {
  Map req = {"roomId": roomId, "newOwner": newOwner};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.changeChatRoomOwner, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}