Validators class

Constructors

Validators()

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

cnic({String message = 'Invalid CNIC'}) → Validator
Pakistan CNIC validator (simple): 13 digits OR formatted 5-7-1 (xxxxx-xxxxxxx-x) CNIC validator (Pakistan specific: 5-7-1 format)
combine(List<Validator> validators) → Validator
Composite: combine multiple validators; returns first non-null error message.
confirmPassword(String originalPassword, {String? message}) → Validator
Confirm password validator
creditCard({String? message}) → Validator
Credit card validator (Luhn algorithm)
date({String format = 'yyyy-MM-dd', String? message}) → Validator
Date validator with multi-format support
email({String? message}) → Validator
Email validator (case-insensitive)
maxLength(int max, {String? message}) → Validator
Max length
minLength(int min, {String? message}) → Validator
Min length
name({String? message}) → Validator
Name validator (letters and spaces only, at least 2 chars)
password({int minLength = 8, bool hasUppercase = false, bool hasLowercase = false, bool hasDigits = false, bool hasSpecialChars = false, String? message}) → Validator
Password strength validator
passwordStrength({int minLength = 8, bool requireUpper = true, bool requireDigits = true, bool requireSpecial = true, String? message}) → Validator
Password strength validator Options: requireUpper, requireDigits, requireSpecial, minLength
pattern(String pattern, {String? message, bool caseSensitive = true}) → Validator
Regex validator
phoneSync({String? message, int minDigits = 7, int maxDigits = 15}) → Validator
required({String? message}) → Validator
Required field
time({String format = 'HH:mm', String? message}) → Validator
Time validator (expects HH:mm in 24h format by default) Time validator
url({String? message}) → Validator
URL / Website validator