diff --git a/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart b/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart index 906a9c35..02b002a3 100644 --- a/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart +++ b/modules/auth/lib/src/features/recover_password/presentation/new_password/new_password_screen.dart @@ -181,6 +181,17 @@ class NewPasswordScreenState extends ConsumerState { )) ] ), + if (viewState.errorMessage.isNotEmpty) ...[ + SizedBox(height: 10), + Text( + viewState.errorMessage, + textAlign: TextAlign.center, + style: const TextStyle( + color: Color.fromRGBO(239, 17, 17, 1), + fontSize: 12, + ), + ), + ], SizedBox(height: 56), PrimaryButton( onPressed: () async { diff --git a/modules/auth/lib/src/features/recover_password/presentation/state/recover_password_view_model.dart b/modules/auth/lib/src/features/recover_password/presentation/state/recover_password_view_model.dart index ca96fbb5..54714b79 100644 --- a/modules/auth/lib/src/features/recover_password/presentation/state/recover_password_view_model.dart +++ b/modules/auth/lib/src/features/recover_password/presentation/state/recover_password_view_model.dart @@ -87,6 +87,7 @@ class RecoverPasswordViewModel extends Notifier { state = state.copyWith( password: raw, + errorMessage: '', equalPasswords: equalPasswords, securityChecks: security, ); @@ -97,6 +98,7 @@ class RecoverPasswordViewModel extends Notifier { final bool equalPasswords = raw == passwordController.text; state = state.copyWith( repeatedPassword: raw, + errorMessage: '', equalPasswords: equalPasswords, ); } @@ -133,7 +135,7 @@ class RecoverPasswordViewModel extends Notifier { if (email.isNotEmpty) { await requestEmail(); - }else if (trimmedNumber.isNotEmpty) { + } else if (trimmedNumber.isNotEmpty) { await requestSms(); } else { state = state.copyWith(