|  |  |  | @ -38,13 +38,10 @@ import 'package:mohem_flutter_app/models/get_mobile_login_info_list_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/member_information_list_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/member_login_list_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/privilege_list_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/ui/chat/call/chat_incoming_call_screen.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/widgets/button/hmg_connectivity_button.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/widgets/input_widget.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:provider/provider.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:signalr_netcore/hub_connection.dart'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | // import 'package:safe_device/safe_device.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:wifi_iot/wifi_iot.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -96,9 +93,7 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  |       callListeners(); | 
		
	
		
			
				|  |  |  |  |       checkAndNavigationCallingPage(); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     if (Platform.isIOS) { | 
		
	
		
			
				|  |  |  |  |       setupVoIPCallBacks(); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     setupVoIPCallBacks(); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   // IOS Voip Call | 
		
	
	
		
			
				
					|  |  |  | @ -119,8 +114,8 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  |       Map<String, dynamic> payload, | 
		
	
		
			
				|  |  |  |  |     ) async { | 
		
	
		
			
				|  |  |  |  |       _iosCallPayload = IosCallPayload.fromJson(payload); | 
		
	
		
			
				|  |  |  |  |       isIncomingCall = _iosCallPayload!.isIncomingCall!; | 
		
	
		
			
				|  |  |  |  |      // _timeOut(); | 
		
	
		
			
				|  |  |  |  |       isIncomingCall = true; | 
		
	
		
			
				|  |  |  |  |       _timeOut(); | 
		
	
		
			
				|  |  |  |  |     }; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     voIPKit.onDidRejectIncomingCall = ( | 
		
	
	
		
			
				
					|  |  |  | @ -136,11 +131,10 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  |       String callerId, | 
		
	
		
			
				|  |  |  |  |     ) async { | 
		
	
		
			
				|  |  |  |  |       var callerID = "did accept call $callerId"; | 
		
	
		
			
				|  |  |  |  |       isIncomingCall = true; | 
		
	
		
			
				|  |  |  |  |       timeOutTimer.cancel(); | 
		
	
		
			
				|  |  |  |  |       await connectCall(); | 
		
	
		
			
				|  |  |  |  |       await voIPKit.acceptIncomingCall(callerState: CallStateType.calling); | 
		
	
		
			
				|  |  |  |  |       await voIPKit.callConnected(); | 
		
	
		
			
				|  |  |  |  |       //await voIPKit. | 
		
	
		
			
				|  |  |  |  |     }; | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -159,27 +153,14 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> connectCall() async { | 
		
	
		
			
				|  |  |  |  |     try { | 
		
	
		
			
				|  |  |  |  |      // Utils.showToast("Connect  " + isIncomingCall.toString(),longDuration: true); | 
		
	
		
			
				|  |  |  |  |       if (isIncomingCall) { | 
		
	
		
			
				|  |  |  |  |         Future.delayed(Duration(seconds: 3),(){ | 
		
	
		
			
				|  |  |  |  |           BuildContext context = AppRoutes.navigatorKey.currentContext!; | 
		
	
		
			
				|  |  |  |  |           Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |           if(context !=null) { | 
		
	
		
			
				|  |  |  |  |             Utils.showToast("Connect ---- Conn" , longDuration: true); | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |           _iosCallPayload!.isIncomingCall = false; | 
		
	
		
			
				|  |  |  |  |           Utils.saveStringFromPrefs("iosCallPayload", jsonEncode(_iosCallPayload)); | 
		
	
		
			
				|  |  |  |  |           var pageRoute = MaterialPageRoute(builder: (context) => StartCallPage()); | 
		
	
		
			
				|  |  |  |  |           Navigator.push(context, pageRoute).whenComplete(() { | 
		
	
		
			
				|  |  |  |  |             //   checkFirebaseToken(); | 
		
	
		
			
				|  |  |  |  |           }); | 
		
	
		
			
				|  |  |  |  |         }); | 
		
	
		
			
				|  |  |  |  |        | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |       BuildContext context = AppRoutes.navigatorKey.currentContext!; | 
		
	
		
			
				|  |  |  |  |       Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |       Utils.saveStringFromPrefs("iosCallPayload", jsonEncode(_iosCallPayload)); | 
		
	
		
			
				|  |  |  |  |       var pageRoute = MaterialPageRoute(builder: (context) => StartCallPage()); | 
		
	
		
			
				|  |  |  |  |       Navigator.push(context, pageRoute).whenComplete(() { | 
		
	
		
			
				|  |  |  |  |         checkFirebaseToken(); | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
		
			
				|  |  |  |  |     } catch (e) { | 
		
	
		
			
				|  |  |  |  |       Utils.showToast("Connect  " + e.toString(),longDuration: true); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |       logger.d(e); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
	
		
			
				
					|  |  |  | @ -199,6 +180,17 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  |   //     print(error); | 
		
	
		
			
				|  |  |  |  |   //   } | 
		
	
		
			
				|  |  |  |  |   // } | 
		
	
		
			
				|  |  |  |  |   // Future<void> connectCall() async { | 
		
	
		
			
				|  |  |  |  |   //   try { | 
		
	
		
			
				|  |  |  |  |   //     UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserCallToken(userid: _iosCallPayload!.incomingCallerId!.split("-").last); | 
		
	
		
			
				|  |  |  |  |   //     if (userLoginResponse.response != null) { | 
		
	
		
			
				|  |  |  |  |   //       AppState().setchatUserDetails = userLoginResponse; | 
		
	
		
			
				|  |  |  |  |   //       Utils.saveStringFromPrefs("userLoginChatDetails", jsonEncode(userLoginResponse.response)); | 
		
	
		
			
				|  |  |  |  |   //     } | 
		
	
		
			
				|  |  |  |  |   //   } catch (e) { | 
		
	
		
			
				|  |  |  |  |   //     logger.d(e); | 
		
	
		
			
				|  |  |  |  |   //   } | 
		
	
		
			
				|  |  |  |  |   // } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> callListeners() async { | 
		
	
		
			
				|  |  |  |  |     try { | 
		
	
	
		
			
				
					|  |  |  | @ -400,8 +392,6 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver { | 
		
	
		
			
				|  |  |  |  |       Utils.showLoading(context); | 
		
	
		
			
				|  |  |  |  |       Future.delayed(const Duration(seconds: 2)).whenComplete(() { | 
		
	
		
			
				|  |  |  |  |         if (!isIncomingCall) { | 
		
	
		
			
				|  |  |  |  |          // isIncomingCall=true; | 
		
	
		
			
				|  |  |  |  |           Utils.showToast("Incoming + $isIncomingCall", longDuration: true); | 
		
	
		
			
				|  |  |  |  |           if (isAppOpenBySystem!) checkFirebaseToken(); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
	
		
			
				
					|  |  |  | 
 |