|  |  |  | @ -297,11 +297,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |         } else if (apiResponse.messageStatus == 1) { | 
		
	
		
			
				|  |  |  |  |           if (apiResponse.data['isSMSSent']) { | 
		
	
		
			
				|  |  |  |  |             _appState.setAppAuthToken = apiResponse.data['LogInTokenID']; | 
		
	
		
			
				|  |  |  |  |             await sendActivationCode( | 
		
	
		
			
				|  |  |  |  |               otpTypeEnum: otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |               phoneNumber: phoneNumberController.text, | 
		
	
		
			
				|  |  |  |  |               nationalIdOrFileNumber: nationalIdController.text, | 
		
	
		
			
				|  |  |  |  |             ); | 
		
	
		
			
				|  |  |  |  |             await sendActivationCode(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumberController.text, nationalIdOrFileNumber: nationalIdController.text, isForRegister: false); | 
		
	
		
			
				|  |  |  |  |           } else { | 
		
	
		
			
				|  |  |  |  |             if (apiResponse.data['IsAuthenticated']) { | 
		
	
		
			
				|  |  |  |  |               await checkActivationCode( | 
		
	
	
		
			
				
					|  |  |  | @ -316,21 +312,23 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> sendActivationCode({required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, dynamic payload}) async { | 
		
	
		
			
				|  |  |  |  |   Future<void> sendActivationCode({required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, required bool isForRegister, dynamic payload}) async { | 
		
	
		
			
				|  |  |  |  |     var request = RequestUtils.getCommonRequestSendActivationCode( | 
		
	
		
			
				|  |  |  |  |       otpTypeEnum: otpTypeEnum, | 
		
	
		
			
				|  |  |  |  |       mobileNumber: phoneNumber, | 
		
	
		
			
				|  |  |  |  |       selectedLoginType: otpTypeEnum.toInt(), | 
		
	
		
			
				|  |  |  |  |       zipCode: selectedCountrySignup.countryCode, | 
		
	
		
			
				|  |  |  |  |       nationalId: int.parse(nationalIdOrFileNumber), | 
		
	
		
			
				|  |  |  |  |         // isFileNo: isPatientHasFile(request: payload), | 
		
	
		
			
				|  |  |  |  |         isFileNo: false, | 
		
	
		
			
				|  |  |  |  |       isFileNo: isForRegister ? isPatientHasFile(request: payload) : false, | 
		
	
		
			
				|  |  |  |  |       patientId: 0, | 
		
	
		
			
				|  |  |  |  |         isForRegister: false, | 
		
	
		
			
				|  |  |  |  |         // isForRegister: checkIsUserComingForRegister(request: payload), | 
		
	
		
			
				|  |  |  |  |         patientOutSA: selectedCountrySignup.countryCode == CountryEnum.saudiArabia ? false : true, | 
		
	
		
			
				|  |  |  |  |         // patientOutSA: isPatientOutsideSA(request: payload), | 
		
	
		
			
				|  |  |  |  |         payload: payload); | 
		
	
		
			
				|  |  |  |  |       isForRegister: isForRegister, | 
		
	
		
			
				|  |  |  |  |       patientOutSA: isForRegister | 
		
	
		
			
				|  |  |  |  |           ? isPatientOutsideSA(request: payload) | 
		
	
		
			
				|  |  |  |  |           : selectedCountrySignup.countryCode == CountryEnum.saudiArabia | 
		
	
		
			
				|  |  |  |  |               ? false | 
		
	
		
			
				|  |  |  |  |               : true, | 
		
	
		
			
				|  |  |  |  |       payload: payload, | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     // TODO: GET APP SMS SIGNATURE HERE | 
		
	
		
			
				|  |  |  |  |     request.sMSSignature = "enKTDcqbOVd"; | 
		
	
	
		
			
				
					|  |  |  | @ -385,7 +383,11 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |                 ? _appState.getUserRegistrationPayload.projectOutSa == 1 | 
		
	
		
			
				|  |  |  |  |                     ? true | 
		
	
		
			
				|  |  |  |  |                     : false | 
		
	
		
			
				|  |  |  |  |                 : _appState.getSelectDeviceByImeiRespModelElement!.outSa!, | 
		
	
		
			
				|  |  |  |  |                 : _appState.getSelectDeviceByImeiRespModelElement != null | 
		
	
		
			
				|  |  |  |  |                     ? _appState.getSelectDeviceByImeiRespModelElement!.outSa! | 
		
	
		
			
				|  |  |  |  |                     : selectedCountrySignup == CountryEnum.saudiArabia | 
		
	
		
			
				|  |  |  |  |                         ? false | 
		
	
		
			
				|  |  |  |  |                         : true, | 
		
	
		
			
				|  |  |  |  |             loginTokenID: _appState.appAuthToken, | 
		
	
		
			
				|  |  |  |  |             registeredData: isForRegister ? _appState.getUserRegistrationPayload : null, | 
		
	
		
			
				|  |  |  |  |             nationIdText: nationalIdController.text, | 
		
	
	
		
			
				
					|  |  |  | @ -677,7 +679,9 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |             otpTypeEnum: OTPTypeEnumExtension.fromInt(request["OTP_SendType"]), | 
		
	
		
			
				|  |  |  |  |             nationalIdOrFileNumber: request["PatientIdentificationID"].toString(), | 
		
	
		
			
				|  |  |  |  |             phoneNumber: request["PatientMobileNumber"].toString(), | 
		
	
		
			
				|  |  |  |  |               payload: request); | 
		
	
		
			
				|  |  |  |  |             payload: request, | 
		
	
		
			
				|  |  |  |  |             isForRegister: true, | 
		
	
		
			
				|  |  |  |  |           ); | 
		
	
		
			
				|  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  |           print("=======IN SA======="); | 
		
	
		
			
				|  |  |  |  |           chekUserNHICData(request: request); | 
		
	
	
		
			
				
					|  |  |  | @ -718,7 +722,9 @@ class AuthenticationViewModel extends ChangeNotifier { | 
		
	
		
			
				|  |  |  |  |           otpTypeEnum: OTPTypeEnumExtension.fromInt(request["OTP_SendType"]), | 
		
	
		
			
				|  |  |  |  |           nationalIdOrFileNumber: request["PatientIdentificationID"].toString(), | 
		
	
		
			
				|  |  |  |  |           phoneNumber: request["PatientMobileNumber"].toString(), | 
		
	
		
			
				|  |  |  |  |             payload: request); | 
		
	
		
			
				|  |  |  |  |           payload: request, | 
		
	
		
			
				|  |  |  |  |           isForRegister: true, | 
		
	
		
			
				|  |  |  |  |         ); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | 
 |