|
|
|
|
@ -102,8 +102,8 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
|
|
|
|
|
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),
|
|
|
|
|
],
|
|
|
|
|
@ -146,11 +146,11 @@ class _NewPasswordScreenState extends State<NewPasswordScreen> {
|
|
|
|
|
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 && hasUppercase && hasLowercase && hasSpecialCharacters && hasMinLength && isMatched && checkRepeatedChars(password);
|
|
|
|
|
return hasDigits && hasUppercase && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool checkRepeatedChars(String password) {
|
|
|
|
|
|