password lowercase check like uppercase (#9343)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-09-13 09:29:00 +08:00 committed by GitHub
parent d65d3b7326
commit ab246fdcbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,11 @@ class LowercaseValidationRule extends ValidationRule {
@override
bool validate(String value) {
return value.contains(RegExp(r'[a-z]'));
return value.runes.any((int rune) {
var character = String.fromCharCode(rune);
return character.toLowerCase() == character &&
character.toUpperCase() != character;
});
}
}