merge-requests/188/head
Aamir Muhammad 2 years ago
parent 01939abc2f
commit 8623942677

@ -204,26 +204,26 @@ class ChatVoipCall {
} on Exception {}
}
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
switch (state) {
case AppLifecycleState.paused:
logger.i('paused');
break;
case AppLifecycleState.inactive:
logger.i('inactive');
break;
case AppLifecycleState.resumed:
logger.i('resumed');
break;
case AppLifecycleState.detached:
logger.i('detached');
break;
}
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
}
// void didChangeAppLifecycleState(AppLifecycleState state) {
// super.didChangeAppLifecycleState(state);
// switch (state) {
// case AppLifecycleState.paused:
// logger.i('paused');
// break;
// case AppLifecycleState.inactive:
// logger.i('inactive');
// break;
// case AppLifecycleState.resumed:
// logger.i('resumed');
// break;
// case AppLifecycleState.detached:
// logger.i('detached');
// break;
// }
// }
//
// @override
// void dispose() {
// WidgetsBinding.instance.removeObserver(this);
// }
}

@ -139,7 +139,7 @@ class AppNotifications extends WidgetsBindingObserver {
}
}
}
AndroidNotificationChannel channel = const AndroidNotificationChannel(
"high_importance_channel",

@ -205,7 +205,6 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
print("------------------ PC Stopped ----------------------------");
_pc.close();
_pc.dispose();
_pc.close();
}
isCallStarted = false;
isVideoCall = false;
@ -217,6 +216,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
isIncomingCall = false;
if (chatHubConnection != null) {
chatHubConnection.stop();
await localVideoRenderer.dispose();
localStream.dispose();
remoteRenderer.dispose();
}
return true;
} else {
@ -229,7 +231,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
if (_pc.connectionState == RTCPeerConnectionState.RTCPeerConnectionStateConnected) {
_pc.close();
_pc.dispose();
_pc.close();
localStream.dispose();
remoteRenderer.dispose();
}
isCallStarted = false;
isVideoCall = false;
@ -237,6 +241,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
isMicOff = false;
isLoudSpeaker = false;
localVideoRenderer.srcObject = null;
await localVideoRenderer.dispose();
remoteRenderer.srcObject = null;
isOutGoingCall = false;
return true;
@ -273,7 +278,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
// isEndedByCaller = true;
endCall().then((bool value) {
Navigator.of(AppRoutes.navigatorKey.currentContext!).pop();
notifyListeners();
// notifyListeners();
isCallEnded = true;
});
}

Loading…
Cancel
Save