leaveChannel abstract method
Sets channel options and leaves the channel.
After calling this method, the SDK stops audio and video interaction, leaves the current channel, and releases all session-related resources. After successfully joining a channel, you must call this method to end the call; otherwise, you cannot start a new call. If you have joined multiple channels using joinChannelEx, calling this method will leave all joined channels. This method is asynchronous. When the method returns, the user has not actually left the channel yet. If you call the release method immediately after this method, the SDK will not trigger the onLeaveChannel callback.
optionsOptions for leaving the channel. See LeaveChannelOptions.
Returns When the method call succeeds, there is no return value; when it fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> leaveChannel({LeaveChannelOptions? options});