|
|
|
|
@ -108,8 +108,8 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
|
|
|
|
|
passwordConstraintsUI(LocaleKeys.minimum8Characters.tr(), password.text.length >= 8),
|
|
|
|
|
8.height,
|
|
|
|
|
passwordConstraintsUI(LocaleKeys.doNotAddRepeatingLetters.tr(), checkRepeatedChars(password.text)),
|
|
|
|
|
8.height,
|
|
|
|
|
passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')),
|
|
|
|
|
// 8.height,
|
|
|
|
|
// passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')),
|
|
|
|
|
8.height,
|
|
|
|
|
passwordConstraintsUI(LocaleKeys.confirmPasswordMustMatch.tr(), password.text.isNotEmpty && password.text == confirmPassword.text),
|
|
|
|
|
],
|
|
|
|
|
@ -134,11 +134,11 @@ class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
|
|
|
|
|
// bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
|
|
|
|
|
bool hasDigits = password.contains(RegExp(r'[0-9]'));
|
|
|
|
|
bool hasLowercase = password.contains(RegExp(r'[a-z]'));
|
|
|
|
|
bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
|
|
|
|
// bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
|
|
|
|
bool hasMinLength = password.length >= minLength;
|
|
|
|
|
bool isMatched = password == confirmPassword.text;
|
|
|
|
|
|
|
|
|
|
return hasDigits && hasLowercase && hasSpecialCharacters && hasMinLength && isMatched && checkRepeatedChars(password);
|
|
|
|
|
return hasDigits && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool checkRepeatedChars(String password) {
|
|
|
|
|
|