|  |  | @ -382,12 +382,16 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); |  |  |  |       _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     final resultEither = |  |  |  |     final resultEither = await _authenticationRepo.sendActivationCodeRepo( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile); |  |  |  |         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), | 
			
		
	
		
		
			
				
					
					|  |  |  |       (apiResponse) async { |  |  |  |       (apiResponse) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         int? patientShareRequestID = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (isFormFamilyFile) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           patientShareRequestID = apiResponse.data['PatientShareRequestID']; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (apiResponse.messageStatus == 2) { |  |  |  |         if (apiResponse.messageStatus == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           LoaderBottomSheet.hideLoader(); |  |  |  |           LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           await _dialogService.showCommonBottomSheetWithoutH( |  |  |  |           await _dialogService.showCommonBottomSheetWithoutH( | 
			
		
	
	
		
		
			
				
					|  |  | @ -400,7 +404,15 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |             LoaderBottomSheet.hideLoader(); |  |  |  |             LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (!isComingFromResendOTP) { |  |  |  |             if (!isComingFromResendOTP) { | 
			
		
	
		
		
			
				
					
					|  |  |  |               navigateToOTPScreen( |  |  |  |               navigateToOTPScreen( | 
			
		
	
		
		
			
				
					
					|  |  |  |                   otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload, isExcludedUser: isExcludedUser); |  |  |  |                 otpTypeEnum: otpTypeEnum, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 phoneNumber: phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 isComingFromRegister: checkIsUserComingForRegister(request: payload), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 payload: payload, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 isExcludedUser: isExcludedUser, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 responseID: responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |               ); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |           } else { |  |  |  |           } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // TODO: Handle isSMSSent false |  |  |  |             // TODO: Handle isSMSSent false | 
			
		
	
	
		
		
			
				
					|  |  | @ -424,8 +436,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       required OTPTypeEnum otpTypeEnum, |  |  |  |       required OTPTypeEnum otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |       required Function(String? message) onWrongActivationCode, |  |  |  |       required Function(String? message) onWrongActivationCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |       Function()? onResendActivation, |  |  |  |       Function()? onResendActivation, | 
			
		
	
		
		
			
				
					
					|  |  |  |       bool isExcludedUser = false, |  |  |  |       bool isFormFamilyFile = false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       dynamic requestID, |  |  |  |       dynamic patientShareRequestID, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       dynamic responseID}) async { |  |  |  |       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); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -453,12 +465,6 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |             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; | 
			
		
	
	
		
		
			
				
					|  |  | @ -468,7 +474,11 @@ 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(newRequest: request, activationCode: activationCode.toString(), isRegister: true); |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         newRequest: request, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         activationCode: activationCode.toString(), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         isRegister: true, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       LoaderBottomSheet.hideLoader(); |  |  |  |       LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -495,7 +505,12 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       }); |  |  |  |       }); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } else { |  |  |  |     } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( |  |  |  |       final resultEither = await _authenticationRepo.checkActivationCodeRepo( | 
			
		
	
		
		
			
				
					
					|  |  |  |           newRequest: CheckActivationCodeRegisterReq.fromJson(request), activationCode: activationCode, isRegister: false, isExcludedUser: isExcludedUser); |  |  |  |           newRequest: CheckActivationCodeRegisterReq.fromJson(request), | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           activationCode: activationCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           isRegister: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           responseID: responseID); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       resultEither.fold( |  |  |  |       resultEither.fold( | 
			
		
	
		
		
			
				
					
					|  |  |  |           (failure) async => await _errorHandlerService.handleError( |  |  |  |           (failure) async => await _errorHandlerService.handleError( | 
			
		
	
	
		
		
			
				
					|  |  | @ -509,6 +524,8 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 LoaderBottomSheet.hideLoader(); |  |  |  |                 LoaderBottomSheet.hideLoader(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {}); |  |  |  |                 await _dialogService.showCommonBottomSheetWithoutH(message: failure.message, label: LocaleKeys.notice.tr(), onOkPressed: () {}); | 
			
		
	
		
		
			
				
					
					|  |  |  |               }), (apiResponse) async { |  |  |  |               }), (apiResponse) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         print("API Response Data: ${apiResponse.data}"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>); |  |  |  |         final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (activation.errorCode == '699') { |  |  |  |         if (activation.errorCode == '699') { | 
			
		
	
	
		
		
			
				
					|  |  | @ -605,14 +622,25 @@ 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, bool isExcludedUser = false}) async { |  |  |  |   Future<void> navigateToOTPScreen( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       {required OTPTypeEnum otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required String phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required bool isComingFromRegister, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       dynamic payload, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isFormFamilyFile = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       bool isExcludedUser = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       int? responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       int? patientShareRequestID}) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |     _navigationService.pushToOtpScreen( |  |  |  |     _navigationService.pushToOtpScreen( | 
			
		
	
		
		
			
				
					
					|  |  |  |       phoneNumber: phoneNumber, |  |  |  |       phoneNumber: phoneNumber, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |       checkActivationCode: (int activationCode) async { |  |  |  |       checkActivationCode: (int activationCode) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |         await checkActivationCode( |  |  |  |         await checkActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |           activationCode: activationCode.toString(), |  |  |  |           activationCode: activationCode.toString(), | 
			
		
	
		
		
			
				
					
					|  |  |  |           isExcludedUser: isExcludedUser, |  |  |  |           isFormFamilyFile: isFormFamilyFile, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           otpTypeEnum: otpTypeEnum, |  |  |  |           otpTypeEnum: otpTypeEnum, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           responseID: responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           patientShareRequestID: patientShareRequestID, | 
			
		
	
		
		
			
				
					
					|  |  |  |           onWrongActivationCode: (String? value) { |  |  |  |           onWrongActivationCode: (String? value) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             onWrongActivationCode(message: value); |  |  |  |             onWrongActivationCode(message: value); | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, |  |  |  |           }, | 
			
		
	
	
		
		
			
				
					|  |  | @ -620,12 +648,16 @@ class AuthenticationViewModel extends ChangeNotifier { | 
			
		
	
		
		
			
				
					
					|  |  |  |       }, |  |  |  |       }, | 
			
		
	
		
		
			
				
					
					|  |  |  |       onResendOTPPressed: (String phoneNumber) async { |  |  |  |       onResendOTPPressed: (String phoneNumber) async { | 
			
		
	
		
		
			
				
					
					|  |  |  |         await sendActivationCode( |  |  |  |         await sendActivationCode( | 
			
		
	
		
		
			
				
					
					|  |  |  |             otpTypeEnum: otpTypeEnum, |  |  |  |           otpTypeEnum: otpTypeEnum, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             phoneNumber: phoneNumberController.text, |  |  |  |           phoneNumber: phoneNumberController.text, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             nationalIdOrFileNumber: nationalIdController.text, |  |  |  |           nationalIdOrFileNumber: nationalIdController.text, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             isForRegister: isComingFromRegister, |  |  |  |           isForRegister: isComingFromRegister, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             isComingFromResendOTP: true, |  |  |  |           isComingFromResendOTP: true, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             payload: payload); |  |  |  |           payload: payload, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           isFormFamilyFile: isFormFamilyFile, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           isExcludedUser: isExcludedUser, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           responseID: responseID, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |       }, |  |  |  |       }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     ); |  |  |  |     ); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |