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