V class abstract
Common validator functions returning an error message or null.
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
-
creditCard(
String? value, {String message = 'Enter a valid card number'}) → String? - Validates a credit card number.
-
email(
String? value, {String message = 'Enter a valid email address'}) → String? - Validates an email address.
-
match(
String other, {String message = 'Values do not match'}) → String? Function(String?) - Validates two values match (e.g. confirm password).
-
maxLength(
String? value, int length, {String? message}) → String? - Validates a maximum length.
-
minLength(
String? value, int length, {String? message}) → String? - Validates a minimum length.
-
number(
String? value, {String message = 'Enter a valid number'}) → String? - Validates a numeric value.
-
phone(
String? value, {String message = 'Enter a valid phone number'}) → String? - Validates a phone number.
-
required(
String? value, {String message = 'This field is required'}) → String? - Validates that a value is not empty.
-
strongPassword(
String? value, {String message = 'Password must be at least 8 characters and include a number'}) → String? - Validates a strong password.
-
url(
String? value, {String message = 'Enter a valid URL'}) → String? - Validates a URL.
-
username(
String? value, {String message = '3–20 letters, numbers or underscores'}) → String? - Validates a username.