NiceValidators class

Common validation rules

Constructors

NiceValidators()

Properties

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

Operators

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

Static Methods

compose(List<String? Function(String?)> validators) String? Function(String?)
Compose multiple validators
creditCard(String? value, [String? message]) String?
Credit card
email(String? value, [String? message]) String?
Email validation
integer(String? value, [String? message]) String?
Integer only
match(String getValue(), [String? message]) String? Function(String?)
Match another field
maxLength(int length, [String? message]) String? Function(String?)
Maximum length
maxValue(num max, [String? message]) String? Function(String?)
Maximum value
minLength(int length, [String? message]) String? Function(String?)
Minimum length
minValue(num min, [String? message]) String? Function(String?)
Minimum value
numeric(String? value, [String? message]) String?
Numeric only
passwordStrength({int minLength = 8, bool requireUppercase = true, bool requireLowercase = true, bool requireDigit = true, bool requireSpecial = false, String? message}) String? Function(String?)
Password strength
pattern(RegExp regex, [String? message]) String? Function(String?)
Pattern match
phone(String? value, [String? message]) String?
Phone number
required(String? value, [String? message]) String?
Required field
url(String? value, [String? message]) String?
URL validation