PasswordValidator class final

Canonical validator for password inputs.

Constructors

PasswordValidator([PasswordValidationConfig config = const PasswordValidationConfig()])
Creates a password validator.
const

Properties

config → PasswordValidationConfig
Rules used during validation.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validate(String input) → ValidationResult<PasswordValidationIssue, String>
Validates a password against the configured policy.

Operators

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

Static Methods

hasDigit(String input) → bool
Returns whether the input contains a digit.
hasLowercase(String input) → bool
Returns whether the input contains a lowercase letter.
hasOnlyRepeatedCharacters(String input) → bool
Returns whether every character in the input is identical.
hasSequentialRun(String input, {int minRun = 4}) → bool
Returns whether the input contains a long increasing or decreasing run.
hasSpecialCharacter(String input) → bool
Returns whether the input contains a special character.
hasUppercase(String input) → bool
Returns whether the input contains an uppercase letter.