validationRules property
A list of all rules to apply to this PasswordPolicy
A rule could be one of the following default ones: DigitRule
,
LengthRule
, LowerCaseRule
, UpperCaseRule
, SpecialCharacterRule
,
NoSpaceRule
.
Or you can create your own rule by extending the ValidationRule
class.
Example rule that checks if password contains the string "1026":
class Contain1026Rule extends ValidationRule {
Contain1026Rule() : super(
impact: 1,
mandatory: true,
name: "Milvintsiss",
);
@override
double computeRuleScore(String password) {
if (password.contains("1026"))
return 1.0;
return 0.0;
}
}
Implementation
final List<ValidationRule> validationRules;