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),
PrimaryButton(
onPressed: () async {

View File

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