AppValidators class

Common form validators for use with form components.

These validators can be used with AppTextFormField and other form inputs.

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

combine(List<String? Function(String?)> validators) String? Function(String?)
Combines multiple validators.
email(String? value, [String? message]) String?
Validates email format.
integer(String? value, [String? message]) String?
Validates that value is an integer.
match(String? otherValue, [String? customMessage]) String? Function(String?)
Validates that two fields match (e.g., password confirmation).
max(num maxValue, [String? customMessage]) String? Function(String?)
Validates maximum value for numeric input.
maxLength(int max, [String? customMessage]) String? Function(String?)
Validates maximum length.
min(num minValue, [String? customMessage]) String? Function(String?)
Validates minimum value for numeric input.
minLength(int min, [String? customMessage]) String? Function(String?)
Validates minimum length.
numeric(String? value, [String? message]) String?
Validates that value is numeric.
password(String? value, [String? message]) String?
Validates password strength (min 8 chars, 1 uppercase, 1 lowercase, 1 number).
pattern(RegExp regex, [String? customMessage]) String? Function(String?)
Validates that value matches a pattern.
phone(String? value, [String? message]) String?
Validates phone number format (exactly 10 digits).
required(String? value, [String? message]) String?
Validates that a field is not empty.
url(String? value, [String? message]) String?
Validates URL format.