addAdmin method

Future<void> addAdmin(
  1. String groupId,
  2. String memberId
)

Adds a group admin.

Only the group owner can call this method and group admins cannot.

Param groupId The group ID.

Param memberId The username of the admin to add.

Throws A description of the exception. See ChatError.

Implementation

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