Added error message text to new password screen
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user