NoSpaceRule class

This rule verify if password contains whitespaces, newlines, tabs, vertical unicode whitespaces. If any is present the password is not validated.

This rule does not check for horizontal Unicode whitespace for convenience as Flutter adds them between characters in TextFormField, if you want to check for horizontal Unicode whitespace set doCheckForHorizontalWhitespaces to true.

isMandatory is true by default.

Inheritance

Constructors

NoSpaceRule({int impact = 1, bool isMandatory = true, String? name, bool doCheckForHorizontalWhitespaces = false})

Properties

doCheckForHorizontalWhitespaces bool
final
hashCode int
The hash code for this object.
no setterinherited
impact int
Used to compute the overall score of the password :
finalinherited
mandatory bool
Define if this rule is mandatory or not, if this rule is not respected and is mandatory, the password will not be validated.
finalinherited
minimumScore double
Minimum score for the rule to be validated.
finalinherited
name String?
Name of the rule, this exists for convenience and will not be used by the PasswordPolicy. All defaults Rules provided by this package have a default name, so if you're using one of them, name cannot be null.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

computeRuleScore(String password) double
Calculate the score of the rule.
override
isRuleRespected(String password) bool
Function that verify if the rule is respected or not.
inherited
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