PasswordRequirement class

Represents a single password requirement.

Constructors

PasswordRequirement({required String description, required bool validator(String password)})
Creates a PasswordRequirement.
const
PasswordRequirement.containsLowercase()
Creates a PasswordRequirement for at least one lowercase letter.
factory
PasswordRequirement.containsNumber()
Creates a PasswordRequirement for at least one number.
factory
PasswordRequirement.containsSpecialCharacter()
Creates a PasswordRequirement for at least one special character.
factory
PasswordRequirement.containsUppercase()
Creates a PasswordRequirement for at least one uppercase letter.
factory
PasswordRequirement.maxLength(int length)
Creates a PasswordRequirement for a maximum length.
factory
PasswordRequirement.minLength(int length)
Creates a PasswordRequirement for a minimum length.
factory

Properties

description String
The text description of the requirement (e.g., "At least 1 uppercase").
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validator bool Function(String password)
Function to check if the password meets this requirement.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

allowedCharacters RegExp
Regular expression for all allowed characters.
final
defaultRequirements List<PasswordRequirement>
Static list of default password requirements.
final
lowercaseLetters RegExp
Regular expression for lowercase letters.
final
numbers RegExp
Regular expression for numbers.
final
specialCharacters RegExp
Regular expression for special characters.
final
uppercaseLetters RegExp
Regular expression for uppercase letters.
final