addChatRoomAdmin method Null safety

Future<void> addChatRoomAdmin(
  1. String roomId,
  2. String admin
)

Adds a chat room admin.

Only the chat room owner can call this method.

Param roomId The chat room ID.

Param admin The ID of the chat room admin to be added.

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

Implementation

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