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

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

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

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

Loading…
Cancel
Save