muteMembers method Null safety

Future<void> muteMembers(
  1. String groupId,
  2. List<String> members,
  3. {int duration = -1}
)

Mutes group members.

Only the group owner or admin can call this method.

Param groupId The group ID.

Param members The list of members to be muted.

Param duration The mute duration in milliseconds.

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

Implementation

Future<void> muteMembers(
  String groupId,
  List<String> members, {
  int duration = -1,
}) async {
  Map req = {'groupId': groupId, 'members': members, 'duration': duration};
  Map result = await _channel.invokeMethod(ChatMethodKeys.muteMembers, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}