mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
forget password changes
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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 ),),)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user