forget password changes

This commit is contained in:
mohammad
2024-08-15 12:50:05 +03:00
parent 562bce8c4f
commit cd372402f7
2 changed files with 7 additions and 7 deletions

View File

@ -58,7 +58,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
add(const UpdateTimerEvent(remainingTime: 0, isButtonEnabled: true));
} else {
add(UpdateTimerEvent(
remainingTime: _remainingTime, isButtonEnabled: false));
remainingTime: _remainingTime,
isButtonEnabled: false));
}
});
}
@ -185,7 +186,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
}
String? validateEmail(String? value) {
if (value == null || value.isEmpty) {
return 'Email is required';
} else if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
@ -373,13 +373,11 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
changeValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
emit(AuthLoading());
validate='';
print('validate');
emit(LoginInitial());
}
changeForgetValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
emit(AuthLoading());
forgetValidate='';
print('validate');
emit(LoginInitial());
}
}

View File

@ -219,10 +219,10 @@ class ForgetPasswordWebPage extends StatelessWidget {
child: Center(
child: InkWell(
onTap: () {
BlocProvider.of<AuthBloc>(context).add(StartTimerEvent());
forgetBloc.add(StartTimerEvent());
},
child: Text(
'Get Code ${state is TimerState && !state.isButtonEnabled ? "(${BlocProvider.of<AuthBloc>(context).formattedTime(state.remainingTime)}) " : ""}',
'Get Code ${state is TimerState && !state.isButtonEnabled && state.remainingTime!=1? "(${forgetBloc.formattedTime(state.remainingTime)}) " : ""}',
style: TextStyle(
color: state is TimerState &&
!state.isButtonEnabled
@ -325,7 +325,9 @@ class ForgetPasswordWebPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [ SizedBox(child: Text(forgetBloc.forgetValidate,
style: const TextStyle(fontWeight: FontWeight.w700,color: ColorsManager.red ),),)],)
style: const TextStyle(fontWeight: FontWeight.w700,color: ColorsManager.red ),),)
],
)
],
),
),