|  |  | @ -376,6 +376,9 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |         isFormFamilyFile: isFormFamilyFile, |  |  |  |         isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |         responseID: responseID); |  |  |  |         responseID: responseID); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // TODO: GET APP SMS SIGNATURE HERE |  |  |  |     // TODO: GET APP SMS SIGNATURE HERE | 
			
		
	
		
		
			
				
					
					|  |  |  |     request.sMSSignature = await getSignature(); |  |  |  |     request.sMSSignature = await getSignature(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -390,10 +393,9 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       (failure) async => await _errorHandlerService.handleError(failure: failure), |  |  |  |       (failure) async => await _errorHandlerService.handleError(failure: failure), | 
			
		
	
		
		
			
				
					
					|  |  |  |       (apiResponse) async { |  |  |  |       (apiResponse) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |         int? patientShareRequestID = 0; |  |  |  |         int? patientShareRequestID = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |         String? familyFileTokenID; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (isFormFamilyFile) { |  |  |  |         if (isFormFamilyFile) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           patientShareRequestID = apiResponse.data['PatientShareRequestID']; |  |  |  |           patientShareRequestID = apiResponse.data['PatientShareRequestID']; | 
			
		
	
		
		
			
				
					
					|  |  |  |           familyFileTokenID = apiResponse.data['LogInTokenID']; |  |  |  |           _appState.setFamilyFileTokenID = apiResponse.data['LogInTokenID']; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (apiResponse.messageStatus == 2) { |  |  |  |         if (apiResponse.messageStatus == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           LoaderBottomSheet.hideLoader(); |  |  |  |           LoaderBottomSheet.hideLoader(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -415,7 +417,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 isExcludedUser: isExcludedUser, |  |  |  |                 isExcludedUser: isExcludedUser, | 
			
		
	
		
		
			
				
					
					|  |  |  |                 responseID: responseID, |  |  |  |                 responseID: responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |                 patientShareRequestID: patientShareRequestID, |  |  |  |                 patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |                   familyFileTokenID: familyFileTokenID); |  |  |  |               ); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |           } else { |  |  |  |           } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // TODO: Handle isSMSSent false |  |  |  |             // TODO: Handle isSMSSent false | 
			
		
	
	
		
		
			
				
					|  |  | @ -441,8 +443,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       Function()? onResendActivation, |  |  |  |       Function()? onResendActivation, | 
			
		
	
		
		
			
				
					
					|  |  |  |       bool isFormFamilyFile = false, |  |  |  |       bool isFormFamilyFile = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |       dynamic patientShareRequestID, |  |  |  |       dynamic patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |       dynamic responseID, |  |  |  |       dynamic responseID}) async { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       String? familyFileTokenID}) 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( | 
			
		
	
	
		
		
			
				
					|  |  | @ -478,11 +479,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       request["ForRegisteration"] = _appState.getUserRegistrationPayload.isRegister; |  |  |  |       request["ForRegisteration"] = _appState.getUserRegistrationPayload.isRegister; | 
			
		
	
		
		
			
				
					
					|  |  |  |       request["isRegister"] = false; |  |  |  |       request["isRegister"] = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         newRequest: request, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         activationCode: activationCode.toString(), |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         isRegister: true, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       LoaderBottomSheet.hideLoader(); |  |  |  |       LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -514,8 +511,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |           isRegister: false, |  |  |  |           isRegister: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |           isFormFamilyFile: isFormFamilyFile, |  |  |  |           isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |           patientShareRequestID: patientShareRequestID, |  |  |  |           patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |           responseID: responseID, |  |  |  |           responseID: responseID); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           familyFileTokenID: familyFileTokenID); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       resultEither.fold( |  |  |  |       resultEither.fold( | 
			
		
	
		
		
			
				
					
					|  |  |  |           (failure) async => await _errorHandlerService.handleError( |  |  |  |           (failure) async => await _errorHandlerService.handleError( | 
			
		
	
	
		
		
			
				
					|  |  | @ -549,17 +545,14 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |           return; |  |  |  |           return; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |           if (isFormFamilyFile) { |  |  |  |           if (isFormFamilyFile) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             _dialogService.showCommonBottomSheetWithoutH( |  |  |  |             await navigateToFamilyFilePage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 message: "Family File Added Successfully", |  |  |  |             // _dialogService.showCommonBottomSheetWithoutH( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 onOkPressed: () { |  |  |  |             //     message: "Family File Added Successfully", | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                   LoaderBottomSheet.showLoader(); |  |  |  |             //     onOkPressed: () async { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                   MedicalFileViewModel medicalFileVM = GetIt.instance<MedicalFileViewModel>(); |  |  |  |             //       print("navigating to family file page"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                   medicalFileVM.getFamilyFiles(); |  |  |  |             // | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                   LoaderBottomSheet.hideLoader(); |  |  |  |             //     }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                   _navigationService.popUntilNamed(AppRoutes.medicalFilePage); |  |  |  |           } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             if (activation.list != null && activation.list!.isNotEmpty) { |  |  |  |             if (activation.list != null && activation.list!.isNotEmpty) { | 
			
		
	
		
		
			
				
					
					|  |  |  |               _appState.setAuthenticatedUser(activation.list!.first); |  |  |  |               _appState.setAuthenticatedUser(activation.list!.first); | 
			
		
	
		
		
			
				
					
					|  |  |  |               _appState.setPrivilegeModelList(activation.list!.first.listPrivilege!); |  |  |  |               _appState.setPrivilegeModelList(activation.list!.first.listPrivilege!); | 
			
		
	
	
		
		
			
				
					|  |  | @ -598,10 +591,16 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             // projectViewModel.analytics.loginRegistration.login_successful(); |  |  |  |             // projectViewModel.analytics.loginRegistration.login_successful(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |       }); |  |  |  |       }); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   Future<void> navigateToFamilyFilePage() async { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     MedicalFileViewModel medicalFileVM = GetIt.instance<MedicalFileViewModel>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     medicalFileVM.handleFamilyFileRequestOTPVerification(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Future<bool> checkIfUserAgreedBefore({required dynamic request}) async { |  |  |  |   Future<bool> checkIfUserAgreedBefore({required dynamic request}) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool isAgreed = false; |  |  |  |     bool isAgreed = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (havePrivilege(109)) { |  |  |  |     if (havePrivilege(109)) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -647,8 +646,7 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       bool isFormFamilyFile = false, |  |  |  |       bool isFormFamilyFile = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |       bool isExcludedUser = false, |  |  |  |       bool isExcludedUser = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |       int? responseID, |  |  |  |       int? responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |       int? patientShareRequestID, |  |  |  |       int? patientShareRequestID}) async { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       String? familyFileTokenID}) async { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     _navigationService.pushToOtpScreen( |  |  |  |     _navigationService.pushToOtpScreen( | 
			
		
	
		
		
			
				
					
					|  |  |  |       phoneNumber: phoneNumber, |  |  |  |       phoneNumber: phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |       isFormFamilyFile: isFormFamilyFile, |  |  |  |       isFormFamilyFile: isFormFamilyFile, | 
			
		
	
	
		
		
			
				
					|  |  | @ -659,7 +657,6 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |           otpTypeEnum: otpTypeEnum, |  |  |  |           otpTypeEnum: otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |           responseID: responseID, |  |  |  |           responseID: responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |           patientShareRequestID: patientShareRequestID, |  |  |  |           patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |           familyFileTokenID: familyFileTokenID, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |           onWrongActivationCode: (String? value) { |  |  |  |           onWrongActivationCode: (String? value) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             onWrongActivationCode(message: value); |  |  |  |             onWrongActivationCode(message: value); | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, |  |  |  |           }, | 
			
		
	
	
		
		
			
				
					|  |  | 
 |