mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +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));
|
add(const UpdateTimerEvent(remainingTime: 0, isButtonEnabled: true));
|
||||||
} else {
|
} else {
|
||||||
add(UpdateTimerEvent(
|
add(UpdateTimerEvent(
|
||||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
remainingTime: _remainingTime,
|
||||||
|
isButtonEnabled: false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -185,7 +186,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String? validateEmail(String? value) {
|
String? validateEmail(String? value) {
|
||||||
|
|
||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
return 'Email is required';
|
return 'Email is required';
|
||||||
} else if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
|
} else if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
|
||||||
@ -373,13 +373,11 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
|||||||
changeValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
|
changeValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
|
||||||
emit(AuthLoading());
|
emit(AuthLoading());
|
||||||
validate='';
|
validate='';
|
||||||
print('validate');
|
|
||||||
emit(LoginInitial());
|
emit(LoginInitial());
|
||||||
}
|
}
|
||||||
changeForgetValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
|
changeForgetValidate(ChangeValidateEvent event, Emitter<AuthState> emit,){
|
||||||
emit(AuthLoading());
|
emit(AuthLoading());
|
||||||
forgetValidate='';
|
forgetValidate='';
|
||||||
print('validate');
|
|
||||||
emit(LoginInitial());
|
emit(LoginInitial());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,10 +219,10 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
BlocProvider.of<AuthBloc>(context).add(StartTimerEvent());
|
forgetBloc.add(StartTimerEvent());
|
||||||
},
|
},
|
||||||
child: Text(
|
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(
|
style: TextStyle(
|
||||||
color: state is TimerState &&
|
color: state is TimerState &&
|
||||||
!state.isButtonEnabled
|
!state.isButtonEnabled
|
||||||
@ -325,7 +325,9 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [ SizedBox(child: Text(forgetBloc.forgetValidate,
|
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