|  |  | @ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/core/common_models/privilege/HMCProjectListM | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/PrivilegeModel.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/PrivilegeModel.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/ProjectDetailListModel.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/ProjectDetailListModel.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/VidaPlusProjectListModel.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/common_models/privilege/VidaPlusProjectListModel.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/core/dependencies.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/enums.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/enums.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/utils/loading_utils.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/utils/loading_utils.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/utils/request_utils.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/utils/request_utils.dart'; | 
			
		
	
	
		
		
			
				
					|  |  | @ -27,6 +28,7 @@ import 'package:hmg_patient_app_new/features/authentication/models/resp_models/a | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_activation_code_resp_model.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_activation_code_resp_model.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; |  |  |  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart'; | 
			
		
	
	
		
		
			
				
					|  |  | @ -345,23 +347,33 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> sendActivationCode( |  |  |  |   Future<void> sendActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |       {required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, required bool isForRegister, dynamic payload, bool isComingFromResendOTP = false}) async { |  |  |  |       {required OTPTypeEnum otpTypeEnum, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required String nationalIdOrFileNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required String phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required bool isForRegister, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       dynamic payload, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isComingFromResendOTP = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isExcludedUser = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isFormFamilyFile = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       int? responseID}) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |     var request = RequestUtils.getCommonRequestSendActivationCode( |  |  |  |     var request = RequestUtils.getCommonRequestSendActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |       otpTypeEnum: otpTypeEnum, |  |  |  |         otpTypeEnum: otpTypeEnum, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       mobileNumber: phoneNumber, |  |  |  |         mobileNumber: phoneNumber, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       selectedLoginType: otpTypeEnum.toInt(), |  |  |  |         selectedLoginType: otpTypeEnum.toInt(), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       zipCode: selectedCountrySignup.countryCode, |  |  |  |         zipCode: selectedCountrySignup.countryCode, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       nationalId: int.parse(nationalIdOrFileNumber), |  |  |  |         nationalId: int.parse(nationalIdOrFileNumber), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       isFileNo: isForRegister ? isPatientHasFile(request: payload) : false, |  |  |  |         isFileNo: isForRegister ? isPatientHasFile(request: payload) : false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       patientId: 0, |  |  |  |         patientId: 0, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       isForRegister: isForRegister, |  |  |  |         isForRegister: isForRegister, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       patientOutSA: isForRegister |  |  |  |         patientOutSA: isForRegister | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           ? isPatientOutsideSA(request: payload) |  |  |  |             ? isPatientOutsideSA(request: payload) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           : selectedCountrySignup.countryCode == CountryEnum.saudiArabia |  |  |  |             : selectedCountrySignup.countryCode == CountryEnum.saudiArabia | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               ? false |  |  |  |                 ? false | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               : true, |  |  |  |                 : true, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       payload: payload, |  |  |  |         payload: payload, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     ); |  |  |  |         isExcludedUser: isExcludedUser, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         responseID: responseID); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // TODO: GET APP SMS SIGNATURE HERE |  |  |  |     // TODO: GET APP SMS SIGNATURE HERE | 
			
		
	
		
		
			
				
					
					|  |  |  |     request.sMSSignature = await getSignature(); |  |  |  |     request.sMSSignature = await getSignature(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -370,7 +382,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); |  |  |  |       _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     final resultEither = await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er'); |  |  |  |     final resultEither = | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     resultEither.fold( |  |  |  |     resultEither.fold( | 
			
		
	
		
		
			
				
					
					|  |  |  |       (failure) async => await _errorHandlerService.handleError(failure: failure), |  |  |  |       (failure) async => await _errorHandlerService.handleError(failure: failure), | 
			
		
	
	
		
		
			
				
					|  |  | @ -385,7 +398,10 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |           if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) { |  |  |  |           if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             LoaderBottomSheet.hideLoader(); |  |  |  |             LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (!isComingFromResendOTP) navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload); |  |  |  |             if (!isComingFromResendOTP) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |               navigateToOTPScreen( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                   otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload, isExcludedUser: isExcludedUser); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |           } else { |  |  |  |           } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // TODO: Handle isSMSSent false |  |  |  |             // TODO: Handle isSMSSent false | 
			
		
	
		
		
			
				
					
					|  |  |  |             // navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber); |  |  |  |             // navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber); | 
			
		
	
	
		
		
			
				
					|  |  | @ -404,7 +420,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> checkActivationCode( |  |  |  |   Future<void> checkActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |       {required String? activationCode, required OTPTypeEnum otpTypeEnum, required Function(String? message) onWrongActivationCode, Function()? onResendActivation}) async { |  |  |  |       {required String? activationCode, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required OTPTypeEnum otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required Function(String? message) onWrongActivationCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       Function()? onResendActivation, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isExcludedUser = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       dynamic requestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       dynamic responseID}) 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( | 
			
		
	
	
		
		
			
				
					|  |  | @ -430,6 +452,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |             //TODO: Error Here IN Zip Code. |  |  |  |             //TODO: Error Here IN Zip Code. | 
			
		
	
		
		
			
				
					
					|  |  |  |             loginType: loginTypeEnum.toInt) |  |  |  |             loginType: loginTypeEnum.toInt) | 
			
		
	
		
		
			
				
					
					|  |  |  |         .toJson(); |  |  |  |         .toJson(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (isExcludedUser) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       request['PatientShareRequestID'] = requestID; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       request['ResponseID'] = responseID; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       request['Status'] = 3; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     LoaderBottomSheet.showLoader(); |  |  |  |     LoaderBottomSheet.showLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (isForRegister) { |  |  |  |     if (isForRegister) { | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob; |  |  |  |       if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob; | 
			
		
	
	
		
		
			
				
					|  |  | @ -465,7 +494,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |       }); |  |  |  |       }); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } else { |  |  |  |     } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false); |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false, isExcludedUser: isExcludedUser); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       resultEither.fold( |  |  |  |       resultEither.fold( | 
			
		
	
		
		
			
				
					
					|  |  |  |           (failure) async => await _errorHandlerService.handleError( |  |  |  |           (failure) async => await _errorHandlerService.handleError( | 
			
		
	
	
		
		
			
				
					|  |  | @ -575,12 +605,13 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |     _navigationService.pushAndReplace(AppRoutes.landingScreen); |  |  |  |     _navigationService.pushAndReplace(AppRoutes.landingScreen); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<void> navigateToOTPScreen({required OTPTypeEnum otpTypeEnum, required String phoneNumber, required bool isComingFromRegister, dynamic payload}) async { |  |  |  |   Future<void> navigateToOTPScreen({required OTPTypeEnum otpTypeEnum, required String phoneNumber, required bool isComingFromRegister, dynamic payload, bool isExcludedUser = false}) async { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     _navigationService.pushToOtpScreen( |  |  |  |     _navigationService.pushToOtpScreen( | 
			
		
	
		
		
			
				
					
					|  |  |  |       phoneNumber: phoneNumber, |  |  |  |       phoneNumber: phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |       checkActivationCode: (int activationCode) async { |  |  |  |       checkActivationCode: (int activationCode) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |         await checkActivationCode( |  |  |  |         await checkActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |           activationCode: activationCode.toString(), |  |  |  |           activationCode: activationCode.toString(), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           isExcludedUser: isExcludedUser, | 
			
		
	
		
		
			
				
					
					|  |  |  |           otpTypeEnum: otpTypeEnum, |  |  |  |           otpTypeEnum: otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |           onWrongActivationCode: (String? value) { |  |  |  |           onWrongActivationCode: (String? value) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             onWrongActivationCode(message: value); |  |  |  |             onWrongActivationCode(message: value); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |