|
...
|
...
|
@@ -43,7 +43,9 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
final isPasswordObscured = true.obs;
|
|
|
|
final isOldPasswordObscured = true.obs;
|
|
|
|
final hasPostUpdatePassword = false.obs;
|
|
|
|
final hasPostUpdateConfirmPassword = false.obs;
|
|
|
|
final hasClickSetAPassword = false.obs;
|
|
|
|
final hasClickSetAConfirmPassword = false.obs;
|
|
|
|
final hasClickVerifyPassword = false.obs;
|
|
|
|
final hasClickForgotSubmitNewPassword = false.obs;
|
|
|
|
|
|
...
|
...
|
@@ -65,6 +67,8 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
|
|
|
|
void _onEmailChanged() {
|
|
|
|
emailInput.value = emailController.text.replaceAll(' ', '').trim();
|
|
|
|
hasSubmittedEmail.value = false;
|
|
|
|
isEmailExist.value = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _onCodeChanged() {
|
|
...
|
...
|
@@ -73,10 +77,17 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
|
|
|
|
void _onPasswordChanged() {
|
|
|
|
passwordInput.value = passwordController.text.trim();
|
|
|
|
hasClickVerifyPassword.value = false;
|
|
|
|
hasClickForgotSubmitNewPassword.value = false;
|
|
|
|
hasPostUpdatePassword.value = false;
|
|
|
|
hasClickSetAPassword.value = false;
|
|
|
|
hasClickSetAConfirmPassword.value = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _onConfirmPasswordChanged() {
|
|
|
|
confirmPasswordInput.value = confirmPasswordController.text.trim();
|
|
|
|
hasPostUpdateConfirmPassword.value = false;
|
|
|
|
hasClickSetAConfirmPassword.value = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _onOldPasswordChanged() {
|
|
...
|
...
|
@@ -211,12 +222,13 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
|
|
|
|
Future<void> setPassword(BuildContext context) async {
|
|
|
|
hasClickSetAPassword.value = true;
|
|
|
|
hasClickSetAConfirmPassword.value = true;
|
|
|
|
if (!isPasswordValid) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!isConfirmPasswordValid2) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (passwordInput.value != confirmPasswordInput.value) {
|
|
...
|
...
|
@@ -248,17 +260,18 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
|
|
|
|
Future<void> changePassword(BuildContext context) async {
|
|
|
|
hasPostUpdatePassword.value = true;
|
|
|
|
hasPostUpdateConfirmPassword.value = true;
|
|
|
|
|
|
|
|
if (oldPasswordInput.value.isEmpty) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!isPasswordValid) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!isConfirmPasswordValid2) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (passwordInput.value != confirmPasswordInput.value) {
|
|
...
|
...
|
@@ -296,7 +309,7 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
Future<void> verifyPassword() async {
|
|
|
|
hasClickVerifyPassword.value = true;
|
|
|
|
if (!isPasswordValid) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try {
|
|
...
|
...
|
@@ -346,11 +359,11 @@ class AddSecurityEmailController extends GetxController { |
|
|
|
Future<void> forgotSubmitNewPassword(BuildContext context) async {
|
|
|
|
hasClickForgotSubmitNewPassword.value = true;
|
|
|
|
if (codeInput.value.isEmpty) {
|
|
|
|
AppToast.show(context.l10n.invalidCode);
|
|
|
|
// AppToast.show(context.l10n.invalidCode);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!isPasswordValid) {
|
|
|
|
AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
// AppToast.show(l10n.invalidPasswordFormat);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try {
|
...
|
...
|
|