@ -108,6 +108,7 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					  Future < void >  clearDefaultInputValues ( )  async  { 
  Future < void >  clearDefaultInputValues ( )  async  { 
 
			
		
	
		
		
			
				
					
					    nationalIdController . clear ( ) ; 
    nationalIdController . clear ( ) ; 
 
			
		
	
		
		
			
				
					
					    phoneNumberController . clear ( ) ; 
    phoneNumberController . clear ( ) ; 
 
			
		
	
		
		
			
				
					
					    emailController . clear ( ) ; 
 
			
		
	
		
		
			
				
					
					    dobController . clear ( ) ; 
    dobController . clear ( ) ; 
 
			
		
	
		
		
			
				
					
					    maritalStatus  =  null ; 
    maritalStatus  =  null ; 
 
			
		
	
		
		
			
				
					
					    genderType  =  null ; 
    genderType  =  null ; 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -324,7 +325,8 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    ) ; 
    ) ; 
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					  Future < void >  sendActivationCode ( { required  OTPTypeEnum  otpTypeEnum ,  required  String  nationalIdOrFileNumber ,  required  String  phoneNumber ,  required  bool  isForRegister ,  dynamic  payload } )  async  { 
  Future < void >  sendActivationCode ( 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					      { required  OTPTypeEnum  otpTypeEnum ,  required  String  nationalIdOrFileNumber ,  required  String  phoneNumber ,  required  bool  isForRegister ,  dynamic  payload ,  bool  isComingFromResendOTP  =  false } )  async  { 
 
			
		
	
		
		
			
				
					
					    var  request  =  RequestUtils . getCommonRequestSendActivationCode ( 
    var  request  =  RequestUtils . getCommonRequestSendActivationCode ( 
 
			
		
	
		
		
			
				
					
					      otpTypeEnum:  otpTypeEnum , 
      otpTypeEnum:  otpTypeEnum , 
 
			
		
	
		
		
			
				
					
					      mobileNumber:  phoneNumber , 
      mobileNumber:  phoneNumber , 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -364,7 +366,7 @@ 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 ( ) ; 
 
			
		
	
		
		
			
				
					
					            navigateToOTPScreen ( otpTypeEnum:  otpTypeEnum ,  phoneNumber:  phoneNumber ) ; 
            if  ( ! isComingFromResendOTP )  navigateToOTPScreen ( otpTypeEnum:  otpTypeEnum ,  phoneNumber:  phoneNumber ,  isComingFromRegister:  checkIsUserComingForRegister ( request:  payload ) ,  payload:  payload ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					          }  else  { 
          }  else  { 
 
			
		
	
		
		
			
				
					
					            / /  TODO:  Handle  isSMSSent  false 
            / /  TODO:  Handle  isSMSSent  false 
 
			
		
	
		
		
			
				
					
					            / /  navigateToOTPScreen ( otpTypeEnum:  otpTypeEnum ,  phoneNumber:  phoneNumber ) ; 
            / /  navigateToOTPScreen ( otpTypeEnum:  otpTypeEnum ,  phoneNumber:  phoneNumber ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -386,8 +388,9 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    required  String ?  activationCode , 
    required  String ?  activationCode , 
 
			
		
	
		
		
			
				
					
					    required  OTPTypeEnum  otpTypeEnum , 
    required  OTPTypeEnum  otpTypeEnum , 
 
			
		
	
		
		
			
				
					
					    required  Function ( String ?  message )  onWrongActivationCode , 
    required  Function ( String ?  message )  onWrongActivationCode , 
 
			
		
	
		
		
			
				
					
					    Function ( ) ?  onResendActivation , 
 
			
		
	
		
		
			
				
					
					  } )  async  { 
  } )  async  { 
 
			
		
	
		
		
			
				
					
					    bool  isForRegister  =  ( _appState . getUserRegistrationPayload . healthId  ! =  null  | |  _appState . getUserRegistrationPayload . patientOutSa  = =  true ) ; 
    bool  isForRegister  =  ( _appState . getUserRegistrationPayload . healthId  ! =  null  | |  _appState . getUserRegistrationPayload . patientOutSa  = =  true  | |  _appState . getUserRegistrationPayload . patientOutSa  = =  1  ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    final  request  =  RequestUtils . getCommonRequestWelcome ( 
    final  request  =  RequestUtils . getCommonRequestWelcome ( 
 
			
		
	
		
		
			
				
					
					            phoneNumber:  phoneNumberController . text , 
            phoneNumber:  phoneNumberController . text , 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -553,7 +556,7 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    _navigationService . pushAndReplace ( AppRoutes . landingScreen ) ; 
    _navigationService . pushAndReplace ( AppRoutes . landingScreen ) ; 
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					  Future < void >  navigateToOTPScreen ( { required  OTPTypeEnum  otpTypeEnum ,  required  String  phoneNumber )  async  { 
  Future < void >  navigateToOTPScreen ( { required  OTPTypeEnum  otpTypeEnum ,  required  String  phoneNumber , required  bool  isComingFromRegister ,  dynamic  payload  })  async  { 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    _navigationService . pushToOtpScreen ( 
    _navigationService . pushToOtpScreen ( 
 
			
		
	
		
		
			
				
					
					      phoneNumber:  phoneNumber , 
      phoneNumber:  phoneNumber , 
 
			
		
	
		
		
			
				
					
					      checkActivationCode:  ( int  activationCode )  async  { 
      checkActivationCode:  ( int  activationCode )  async  { 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -562,11 +565,18 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					          otpTypeEnum:  otpTypeEnum , 
          otpTypeEnum:  otpTypeEnum , 
 
			
		
	
		
		
			
				
					
					          onWrongActivationCode:  ( String ?  value )  { 
          onWrongActivationCode:  ( String ?  value )  { 
 
			
		
	
		
		
			
				
					
					            onWrongActivationCode ( message:  value ) ; 
            onWrongActivationCode ( message:  value ) ; 
 
			
		
	
		
		
			
				
					
					            } ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					        / /  Navigator . of ( context ) . push ( MaterialPageRoute ( builder:  ( BuildContext  context )  = >  RegisterNewStep2 ( null ,  { " nationalID " :  " 12345678654321 " } ) ) ) ; 
 
			
		
	
		
		
			
				
					
					          } , 
          } , 
 
			
		
	
		
		
			
				
					
					      onResendOTPPressed:  ( String  phoneNumber )  { } , 
        ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					      } , 
 
			
		
	
		
		
			
				
					
					      onResendOTPPressed:  ( String  phoneNumber )  async  { 
 
			
		
	
		
		
			
				
					
					        await  sendActivationCode ( 
 
			
		
	
		
		
			
				
					
					            otpTypeEnum:  otpTypeEnum , 
 
			
		
	
		
		
			
				
					
					            phoneNumber:  phoneNumberController . text , 
 
			
		
	
		
		
			
				
					
					            nationalIdOrFileNumber:  nationalIdController . text , 
 
			
		
	
		
		
			
				
					
					            isForRegister:  isComingFromRegister , 
 
			
		
	
		
		
			
				
					
					            isComingFromResendOTP:  true , 
 
			
		
	
		
		
			
				
					
					            payload:  payload ) ; 
 
			
		
	
		
		
			
				
					
					      } , 
 
			
		
	
		
		
			
				
					
					    ) ; 
    ) ; 
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -649,19 +659,18 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					  Future < void >  onRegistrationComplete ( )  async  { 
  Future < void >  onRegistrationComplete ( )  async  { 
 
			
		
	
		
		
			
				
					
					    LoaderBottomSheet . showLoader ( ) ; 
 
			
		
	
		
		
			
				
					
					    var  request  =  RequestUtils . getUserSignupCompletionRequest ( fullName:  nameController . text ,  emailAddress:  emailController . text ,  gender:  genderType ,  maritalStatus:  maritalStatus ) ; 
    var  request  =  RequestUtils . getUserSignupCompletionRequest ( fullName:  nameController . text ,  emailAddress:  emailController . text ,  gender:  genderType ,  maritalStatus:  maritalStatus ) ; 
 
			
		
	
		
		
			
				
					
					    / / 
 
			
		
	
		
		
			
				
					
					    print ( " ============= Final Payload =============== " ) ; 
 
			
		
	
		
		
			
				
					
					    print ( request ) ; 
 
			
		
	
		
		
			
				
					
					    print ( " ===================  ==================== " ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    final  resultEither  =  await  _authenticationRepo . registerUser ( registrationPayloadDataModelRequest:  request ) ; 
    final  resultEither  =  await  _authenticationRepo . registerUser ( registrationPayloadDataModelRequest:  request ) ; 
 
			
		
	
		
		
			
				
					
					    resultEither . fold ( ( failure )  async  = >  await  _errorHandlerService . handleError ( failure:  failure ) ,  ( apiResponse )  async  { 
    resultEither . fold ( ( failure )  async  = >  await  _errorHandlerService . handleError ( failure:  failure ) ,  ( apiResponse )  async  { 
 
			
		
	
		
		
			
				
					
					      if  ( apiResponse . data  is  String )  { 
      if  ( apiResponse . data  is  String )  { 
 
			
		
	
		
		
			
				
					
					        / / TODO:  This  Section  Need  to  Be  Testing . 
 
			
		
	
		
		
			
				
					
					        _dialogService . showExceptionBottomSheet ( message:  apiResponse . data ,  onOkPressed:  ( )  { } ,  onCancelPressed:  ( )  { } ) ; 
 
			
		
	
		
		
			
				
					
					        / / TODO:  Here  We  Need  to  Show  a  Dialog  Of  Something  in  the  case  of  Fail  With  OK  and  Cancel  and  the  Display  Variable  WIll  be  result . 
        / / TODO:  Here  We  Need  to  Show  a  Dialog  Of  Something  in  the  case  of  Fail  With  OK  and  Cancel  and  the  Display  Variable  WIll  be  result . 
 
			
		
	
		
		
			
				
					
					      }  else  { 
      }  else  { 
 
			
		
	
		
		
			
				
					
					        print ( apiResponse . data  as  Map < String ,  dynamic > ) ; 
        print ( apiResponse . data  as  Map < String ,  dynamic > ) ; 
 
			
		
	
		
		
			
				
					
					        if  ( apiResponse . data [ " MessageStatus " ]  = =  1 )  { 
        if  ( apiResponse . data [ " MessageStatus " ]  = =  1 )  { 
 
			
		
	
		
		
			
				
					
					          LoaderBottomSheet . hideLoader ( ) ; 
 
			
		
	
		
		
			
				
					
					          / / TODO:  Here  We  Need  to  Show  a  Dialog  Of  Something  in  the  case  of  Success . 
          / / TODO:  Here  We  Need  to  Show  a  Dialog  Of  Something  in  the  case  of  Success . 
 
			
		
	
		
		
			
				
					
					          await  clearDefaultInputValues ( ) ;  / /  This  will  Clear  All  Default  Values  Of  User . 
          await  clearDefaultInputValues ( ) ;  / /  This  will  Clear  All  Default  Values  Of  User . 
 
			
		
	
		
		
			
				
					
					          _navigationService . pushAndReplace ( AppRoutes . loginScreen ) ; 
          _navigationService . pushAndReplace ( AppRoutes . loginScreen ) ; 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -722,8 +731,6 @@ class AuthenticationViewModel extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    }  else  { 
    }  else  { 
 
			
		
	
		
		
			
				
					
					      isOutSideSa  =  false ; 
      isOutSideSa  =  false ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    print ( isOutSideSa ) ; 
 
			
		
	
		
		
			
				
					
					    return  isOutSideSa ; 
    return  isOutSideSa ; 
 
			
		
	
		
		
			
				
					
					  } 
  }