uninit method
Deinitialize the PIP functionality.
This method cleans up all resources and stops the PIP system. It should be called when the app is shutting down or when PIP is no longer needed.
This method will:
- Logout from the room if logged in
- Destroy the ZEGO Express engine if expressConfig is not null on init
- Clean up all PIP-related resources
Implementation
Future<void> uninit() async {
if (!private.isInit) {
return;
}
private.isInit = false;
private.pipConfig = ZegoPIPConfig();
if (private.isLoginRoom) {
private.roomID = '';
private.isLoginRoom = false;
private.isRoomLogin = false;
await ZegoExpressEngine.instance.logoutRoom();
}
if (null != private.expressConfig) {
await ZegoExpressEngine.destroyEngine();
}
private.expressConfig = null;
}