Password class

A strong password: a minimum length, plus the character kinds you ask for.

@Password(min: 8, mixedCase: true, numbers: true, symbols: true)
final String password;

v.string().password(min: 8, mixedCase: true, numbers: true)

Letters, numbers and symbols use Unicode classes, so é is a letter. It does not check leaked passwords.

Inheritance

Constructors

Password({int min = 8, bool letters = false, bool mixedCase = false, bool numbers = false, bool symbols = false, String? message})
const

Properties

defaultMessage → String
Message template used when no custom message is set.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
isAsync → bool
true when the rule needs checkAsync. Then use parseAsync.
no setterinherited
letters → bool
At least one letter.
final
message → String?
Custom message for this rule. It wins over every other message.
finalinherited
min → int
At least this many characters.
final
mixedCase → bool
At least one upper case and one lower case letter.
final
name → String
Rule name. Also used as the issue code.
no setteroverride
numbers → bool
At least one number.
final
params → Map<String, Object?>
Values for the message placeholders, like {'min': 3}.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
symbols → bool
At least one symbol, like ! or @.
final

Methods

apply(String value, RuleContext context) → bool
Run the rule and add an issue when it fails. Returns true on pass.
inherited
applyAsync(String value, RuleContext context) → Future<bool>
Async version of apply.
inherited
check(String value, RuleContext context) → bool
Return true when value is valid.
override
checkAsync(String value, RuleContext context) → Future<bool>
Async version of check. The default calls check.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJsonSchema() → Map<String, dynamic>
Extra JSON Schema keys, like {'format': 'email'}.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited