@ -18,26 +18,25 @@ import 'package:hmg_patient_app_new/widgets/bottomsheet/generic_bottom_sheet.dar
 
		
	
		
			
				import  ' package:hmg_patient_app_new/widgets/buttons/custom_button.dart ' ;  
		
	
		
			
				import  ' package:provider/provider.dart ' ;  
		
	
		
			
				
 
		
	
		
			
				
 
		
	
		
			
				class  SavedLogin  extends  StatefulWidget  {  
		
	
		
			
				
 
		
	
		
			
				
 
		
	
		
			
				   const  SavedLogin ( { Key ?  key } )  :  super ( key:  key ) ; 
 
		
	
		
			
				  const  SavedLogin ( { Key ?  key } )  :  super ( key:  key ) ; 
 
		
	
		
			
				
 
		
	
		
			
				  @ override 
 
		
	
		
			
				  _SavedLogin  createState ( )  = >  _SavedLogin ( ) ; 
 
		
	
		
			
				}  
		
	
		
			
				
 
		
	
		
			
				class  _SavedLogin  extends  State < SavedLogin >  {  
		
	
		
			
				
 
		
	
		
			
				  LoginTypeEnum  loginType  =  LoginTypeEnum . sms ; 
 
		
	
		
			
				  late  AuthenticationViewModel  authVm ; 
 
		
	
		
			
				  late  AppState  appState ; 
 
		
	
		
			
				
 
		
	
		
			
				  @ override 
 
		
	
		
			
				  void  initState ( )  { 
 
		
	
		
			
				    authVm  =  context . read < AuthenticationViewModel > ( ) ; 
 
		
	
		
			
				    appState  =  getIt . get < AppState > ( ) ; 
 
		
	
		
			
				    authVm . phoneNumberController . text  =  appState . getSelectDeviceByImeiRespModelElement ! . mobile ! ; 
 
		
	
		
			
				    authVm . phoneNumberController . text  =  appState . getSelectDeviceByImeiRespModelElement ! . mobile ! . startsWith ( " 0 " ) 
 
		
	
		
			
				        ?  appState . getSelectDeviceByImeiRespModelElement ! . mobile ! . replaceFirst ( " 0 " ,  " " ) 
 
		
	
		
			
				        :  appState . getSelectDeviceByImeiRespModelElement ! . mobile ! ; 
 
		
	
		
			
				    authVm . nationalIdController . text  =  appState . getSelectDeviceByImeiRespModelElement ! . identificationNo ! ; 
 
		
	
		
			
				
 
		
	
		
			
				    super . initState ( ) ; 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -45,11 +44,12 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				
 
		
	
		
			
				  @ override 
 
		
	
		
			
				  Widget  build ( BuildContext  context )  { 
 
		
	
		
			
				
 
		
	
		
			
				
 
		
	
		
			
				    return  Scaffold ( 
 
		
	
		
			
				      backgroundColor:  AppColors . scaffoldBgColor , 
 
		
	
		
			
				      appBar:  CustomAppBar ( 
 
		
	
		
			
				        onBackPressed:  ( )  { } , 
 
		
	
		
			
				        onBackPressed:  ( )  { 
 
		
	
		
			
				          Navigator . of ( context ) . pop ( ) ; 
 
		
	
		
			
				        } , 
 
		
	
		
			
				        onLanguageChanged:  ( lang )  { } , 
 
		
	
		
			
				      ) , 
 
		
	
		
			
				      body:  SafeArea ( 
 
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -78,12 +78,16 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				                  children:  [ 
 
		
	
		
			
				                    / /  Last  login  info 
 
		
	
		
			
				
 
		
	
		
			
				                    ( " ${ LocaleKeys . lastloginBy . tr ( )  }   ${ LoginTypeExtension . fromValue ( appState . getSelectDeviceByImeiRespModelElement ! . logInType ! ) ! . displayName } " 
 
		
	
		
			
				        ) . toText14 ( isBold:  true ,  color:  AppColors . greyTextColor ) , 
 
		
	
		
			
				                    ( appState . getSelectDeviceByImeiRespModelElement ! . createdOn  ! =  null  ?  DateUtil . getFormattedDate ( DateUtil . convertStringToDate ( appState . getSelectDeviceByImeiRespModelElement ! . createdOn ! ) ,  " d MMMM, y at HH:mm " )  :  ' -- ' ) 
 
		
	
		
			
				                    ( " ${ LocaleKeys . lastloginBy . tr ( ) }   ${ LoginTypeExtension . fromValue ( appState . getSelectDeviceByImeiRespModelElement ! . logInType ! ) ! . displayName } " ) 
 
		
	
		
			
				                        . toText14 ( isBold:  true ,  color:  AppColors . greyTextColor ) , 
 
		
	
		
			
				                    ( appState . getSelectDeviceByImeiRespModelElement ! . createdOn  ! =  null 
 
		
	
		
			
				                            ?  DateUtil . getFormattedDate ( DateUtil . convertStringToDate ( appState . getSelectDeviceByImeiRespModelElement ! . createdOn ! ) ,  " d MMMM, y at HH:mm " ) 
 
		
	
		
			
				                            :  ' -- ' ) 
 
		
	
		
			
				                        . toText16 ( isBold:  true ,  color:  AppColors . textColor ) , 
 
		
	
		
			
				
 
		
	
		
			
				                    Container ( margin:  EdgeInsets . all ( 16. h ) ,  child:  Utils . buildSvgWithAssets ( icon:  getTypeIcons ( loginType . toInt ) ,  height:  54 ,  width:  54 ,  iconColor:  loginType . toInt  = =  4  ?  null  :  AppColors . primaryRedColor ) ) , 
 
		
	
		
			
				                    Container ( 
 
		
	
		
			
				                        margin:  EdgeInsets . all ( 16. h ) , 
 
		
	
		
			
				                        child:  Utils . buildSvgWithAssets ( icon:  getTypeIcons ( loginType . toInt ) ,  height:  54 ,  width:  54 ,  iconColor:  loginType . toInt  = =  4  ?  null  :  AppColors . primaryRedColor ) ) , 
 
		
	
		
			
				                    / /  Face  ID  login  button 
 
		
	
		
			
				                    SizedBox ( 
 
		
	
		
			
				                      height:  45 , 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -92,8 +96,7 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				                        onPressed:  ( )  { 
 
		
	
		
			
				                          if  ( loginType  = =  LoginTypeEnum . fingerprint  | |  loginType  = =  LoginTypeEnum . face )  { 
 
		
	
		
			
				                            authVm . loginWithFingerPrintFace ( loginType . toInt ) ; 
 
		
	
		
			
				                          } 
 
		
	
		
			
				                          else  { 
 
		
	
		
			
				                          }  else  { 
 
		
	
		
			
				                            / /  int ?  val  =  loginType . toInt ; 
 
		
	
		
			
				                            authVm . checkUserAuthentication ( otpTypeEnum:  loginType  = =  LoginTypeEnum . sms  ?  OTPTypeEnum . sms  :  OTPTypeEnum . whatsapp ) ; 
 
		
	
		
			
				                          } 
 
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -157,7 +160,7 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				                                                    Navigator . of ( context ) . pop ( ) ; 
 
		
	
		
			
				                                                    loginType  =  LoginTypeEnum . sms ; 
 
		
	
		
			
				                                                    int ?  val  =  loginType . toInt ; 
 
		
	
		
			
				                                                      authVm . checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . sms   ) ; 
 
		
	
		
			
				                                                    authVm . checkUserAuthentication ( otpTypeEnum:   OTPTypeEnum . sms ) ; 
 
		
	
		
			
				                                                  } , 
 
		
	
		
			
				                                                  backgroundColor:  AppColors . primaryRedColor , 
 
		
	
		
			
				                                                  borderColor:  AppColors . primaryRedBorderColor , 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -180,7 +183,7 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				                                                    Navigator . of ( context ) . pop ( ) ; 
 
		
	
		
			
				                                                    loginType  =  LoginTypeEnum . whatsapp ; 
 
		
	
		
			
				                                                    int ?  val  =  loginType . toInt ; 
 
		
	
		
			
				                                                    authVm . checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . whatsapp   ) ; 
 
		
	
		
			
				                                                    authVm . checkUserAuthentication ( otpTypeEnum:   OTPTypeEnum . whatsapp ) ; 
 
		
	
		
			
				                                                  } , 
 
		
	
		
			
				                                                  backgroundColor:  AppColors . transparent , 
 
		
	
		
			
				                                                  borderColor:  AppColors . textColor , 
 
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -216,8 +219,7 @@ class _SavedLogin extends State<SavedLogin> {
 
		
	
		
			
				                        }  else  { 
 
		
	
		
			
				                          loginType  =  LoginTypeEnum . whatsapp ; 
 
		
	
		
			
				                          int ?  val  =  loginType . toInt ; 
 
		
	
		
			
				                          authVm . checkUserAuthentication ( otpTypeEnum: OTPTypeEnum . whatsapp  ) ; 
 
		
	
		
			
				
 
		
	
		
			
				                          authVm . checkUserAuthentication ( otpTypeEnum:  OTPTypeEnum . whatsapp ) ; 
 
		
	
		
			
				                        } 
 
		
	
		
			
				                      } , 
 
		
	
		
			
				                      backgroundColor:  AppColors . whiteColor ,