|  |  | @ -48,6 +48,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   final DialogService _dialogService; |  |  |  |   final DialogService _dialogService; | 
			
		
	
		
		
			
				
					
					|  |  |  |   final NavigationService _navigationService; |  |  |  |   final NavigationService _navigationService; | 
			
		
	
		
		
			
				
					
					|  |  |  |   final LocalAuthService _localAuthService; |  |  |  |   final LocalAuthService _localAuthService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   AuthenticationViewModel({ |  |  |  |   AuthenticationViewModel({ | 
			
		
	
		
		
			
				
					
					|  |  |  |     required AppState appState, |  |  |  |     required AppState appState, | 
			
		
	
		
		
			
				
					
					|  |  |  |     required AuthenticationRepo authenticationRepo, |  |  |  |     required AuthenticationRepo authenticationRepo, | 
			
		
	
	
		
		
			
				
					|  |  | @ -79,6 +80,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   CalenderEnum calenderType = CalenderEnum.gregorian; |  |  |  |   CalenderEnum calenderType = CalenderEnum.gregorian; | 
			
		
	
		
		
			
				
					
					|  |  |  |   LoginTypeEnum loginTypeEnum = LoginTypeEnum.sms; |  |  |  |   LoginTypeEnum loginTypeEnum = LoginTypeEnum.sms; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   final ValueNotifier<bool> otpScreenNotifier = ValueNotifier<bool>(false); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   //================== |  |  |  |   //================== | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   String errorMsg = ''; |  |  |  |   String errorMsg = ''; | 
			
		
	
	
		
		
			
				
					|  |  | @ -106,7 +109,6 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> clearDefaultInputValues() async { |  |  |  |   Future<void> clearDefaultInputValues() async { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     nationalIdController.clear(); |  |  |  |     nationalIdController.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     phoneNumberController.clear(); |  |  |  |     phoneNumberController.clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     emailController.clear(); |  |  |  |     emailController.clear(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -394,12 +396,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |     return isUserComingForRegister; |  |  |  |     return isUserComingForRegister; | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> checkActivationCode({ |  |  |  |   Future<void> checkActivationCode( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     required String? activationCode, |  |  |  |       {required String? activationCode, required OTPTypeEnum otpTypeEnum, required Function(String? message) onWrongActivationCode, Function()? onResendActivation}) async { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     required OTPTypeEnum otpTypeEnum, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     required Function(String? message) onWrongActivationCode, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Function()? onResendActivation, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   }) async { |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1); |  |  |  |     bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     final request = RequestUtils.getCommonRequestWelcome( |  |  |  |     final request = RequestUtils.getCommonRequestWelcome( | 
			
		
	
	
		
		
			
				
					|  |  | @ -422,6 +420,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |             countryCode: _appState.getSelectDeviceByImeiRespModelElement != null && _appState.getSelectDeviceByImeiRespModelElement!.outSa == true |  |  |  |             countryCode: _appState.getSelectDeviceByImeiRespModelElement != null && _appState.getSelectDeviceByImeiRespModelElement!.outSa == true | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ? CountryEnum.unitedArabEmirates.countryCode |  |  |  |                 ? CountryEnum.unitedArabEmirates.countryCode | 
			
		
	
		
		
			
				
					
					|  |  |  |                 : selectedCountrySignup.countryCode, |  |  |  |                 : selectedCountrySignup.countryCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //TODO: Error Here IN Zip Code. | 
			
		
	
		
		
			
				
					
					|  |  |  |             loginType: loginTypeEnum.toInt) |  |  |  |             loginType: loginTypeEnum.toInt) | 
			
		
	
		
		
			
				
					
					|  |  |  |         .toJson(); |  |  |  |         .toJson(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     LoaderBottomSheet.showLoader(); |  |  |  |     LoaderBottomSheet.showLoader(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -469,6 +468,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |               failure: failure, |  |  |  |               failure: failure, | 
			
		
	
		
		
			
				
					
					|  |  |  |               onUnHandledFailure: (failure) async { |  |  |  |               onUnHandledFailure: (failure) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 LoaderBottomSheet.hideLoader(); |  |  |  |                 LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 otpScreenNotifier.value = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {}); |  |  |  |                 await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {}); | 
			
		
	
		
		
			
				
					
					|  |  |  |               }, |  |  |  |               }, | 
			
		
	
		
		
			
				
					
					|  |  |  |               onMessageStatusFailure: (failure) async { |  |  |  |               onMessageStatusFailure: (failure) async { | 
			
		
	
	
		
		
			
				
					|  |  | @ -595,6 +595,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> onWrongActivationCode({String? message}) async { |  |  |  |   Future<void> onWrongActivationCode({String? message}) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     otpScreenNotifier.value = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |     await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); |  |  |  |     await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -622,19 +623,20 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   checkLastLoginStatus(Function() onSuccess) async { |  |  |  |   checkLastLoginStatus(Function() onSuccess) async { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Future.delayed(Duration(seconds: 1), () async { |  |  |  |     Future.delayed(Duration(seconds: 1), () async { | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) { |  |  |  |       if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (_appState.getSelectDeviceByImeiRespModelElement != null && |  |  |  |         if (_appState.getSelectDeviceByImeiRespModelElement != null && | 
			
		
	
		
		
			
				
					
					|  |  |  |             (_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) { |  |  |  |             (_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           phoneNumberController.text = |  |  |  |           phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!; |  |  |  |               ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |               : _appState.getAuthenticatedUser()!.mobileNumber)!; | 
			
		
	
		
		
			
				
					
					|  |  |  |           nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; |  |  |  |           nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; | 
			
		
	
		
		
			
				
					
					|  |  |  |           onSuccess(); |  |  |  |           onSuccess(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && |  |  |  |         } else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && | 
			
		
	
		
		
			
				
					
					|  |  |  |             _appState.getAuthenticatedUser() != null) { |  |  |  |             _appState.getAuthenticatedUser() != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           phoneNumberController.text = |  |  |  |           phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!; |  |  |  |               ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |               : _appState.getAuthenticatedUser()!.mobileNumber)!; | 
			
		
	
		
		
			
				
					
					|  |  |  |           nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; |  |  |  |           nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!; | 
			
		
	
		
		
			
				
					
					|  |  |  |           onSuccess(); |  |  |  |           onSuccess(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -921,4 +923,6 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       }, |  |  |  |       }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     ); |  |  |  |     ); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | // === OTP Widget Logics ===// | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |