Added error message text to new password screen

This commit is contained in:
2025-12-17 12:39:41 +01:00
parent 2e3681d36d
commit ce062ec6e8
2 changed files with 14 additions and 1 deletions

View File

@@ -181,6 +181,17 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
)) ))
] ]
), ),
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), SizedBox(height: 56),
PrimaryButton( PrimaryButton(
onPressed: () async { onPressed: () async {

View File

@@ -87,6 +87,7 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
state = state.copyWith( state = state.copyWith(
password: raw, password: raw,
errorMessage: '',
equalPasswords: equalPasswords, equalPasswords: equalPasswords,
securityChecks: security, securityChecks: security,
); );
@@ -97,6 +98,7 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
final bool equalPasswords = raw == passwordController.text; final bool equalPasswords = raw == passwordController.text;
state = state.copyWith( state = state.copyWith(
repeatedPassword: raw, repeatedPassword: raw,
errorMessage: '',
equalPasswords: equalPasswords, equalPasswords: equalPasswords,
); );
} }
@@ -133,7 +135,7 @@ class RecoverPasswordViewModel extends Notifier<RecoverPasswordViewState> {
if (email.isNotEmpty) { if (email.isNotEmpty) {
await requestEmail(); await requestEmail();
}else if (trimmedNumber.isNotEmpty) { } else if (trimmedNumber.isNotEmpty) {
await requestSms(); await requestSms();
} else { } else {
state = state.copyWith( state = state.copyWith(