leaveGroup method

Future<void> leaveGroup(
  1. String groupId
)

Leaves a group. The group owner cannot leave, only can destroy the group.

Param groupId The group ID.

Returns None.

Throws Exception description, see ChatError.

Implementation

Future<void> leaveGroup(String groupId) async {
  try {
    Map req = {'groupId': groupId};
    Map result = await platform_interface.Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.leaveGroup, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}