leaveChannel method

Future<void> leaveChannel()

Leaves a channel. This method releases all resources related to the session. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel. After joining the channel, you must call this method to end the call; otherwise, you cannot join the next call. After joining the channel, you must call this method or to end the call; otherwise, you cannot join the next call. A successful call of this method triggers the following callbacks: The local client: leaveChannel . The remote client: userOffline , if the user joining the channel is in the Communication profile, or is a host in the Live-broadcasting profile. If you call destroy immediately after calling this method, the SDK does not trigger the leaveChannel callback. If you call this method during a CDN live streaming, the SDK automatically calls the removePublishStreamUrl method.

Implementation

Future<void> leaveChannel() async {
  await _engine!.leaveChannel();
}