FormValidator class

Constructors

FormValidator()

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

alpha(String? value, {String? message}) String?
Checks if the value is alphabetic, i.e., contains only letters.
alphanumeric(String? value, {String? message}) String?
Checks if the value is alphanumeric, i.e., contains only letters and numbers.
creditCard(String? value, {String? message}) String?
Checks if the value is a valid credit card number.
date(String? value, {String? message}) String?
Checks if the value is a valid date.
dateRange(String? value, {String? message, required dynamic min, required dynamic max}) String?
Checks if the value is a valid date range.
divisibleBy(String? value, {String? message, required int divisor}) String?
Checks if the value is divisible by a given divisor
email(String? value, {String? message}) String?
emailOrPhone(String? value, {String? message}) String?
Check if the value is a valid email address or a phone number.
emailOrUrl(String? value, {String? message}) String?
Check if the value is a valid email address or a url.
fixedLength(String? value, {String? message, required int length}) String?
Check if the
float(String? value, {String? message}) String?
Check if the value is a floating point number.
hex(String? value, {String? message}) String?
Check if the value is a valid hexadecimal number.
integer(String? value, {String? message}) String?
Check if the value is an integer.
isAfter(String? value, {String? message, required dynamic min}) String?
Check if the value (a Date) is after the given Date.
isBefore(String? value, {String? message, required dynamic max}) String?
Check if the value (a Date) is before the given Date.
lowerCase(String? value, {String? message}) String?
Check if the value is in lowercase
match(String? value, {String? message, required String pattern}) String?
Check if the value matches the given RegExp pattern.
max(String? value, {String? message, required int length}) String?
Check if the value is less than the given maximum value.
maxLength(String? value, {String? message, required int length}) String?
Check if the value's length is less than or equal to the given maximum length.
min(String? value, {String? message, required int length}) String?
Check if the value is more than or equal to the given minimum value.
minLength(String? value, {String? message, required int length}) String?
Check if the value's length is more than or equal to the given minimum length.
name(String? value, {String? message}) String?
Check if the value is an acceptable name string (alpha with '.' and space characters).
notNull(String? value, {String? message}) String?
Check if the value is not null.
nullValue(String? value, {String? message}) String?
numeric(String? value, {String? message}) String?
phone(String? value, {String? message}) String?
Check if the value is a valid phone number.
required(String? value, {String? message}) String?
Check if any value is entered.
simpleURL(String? value, {String? message}) String?
Check if the value is a valid URL. This is a simple check.
upperCase(String? value, {String? message}) String?
Check if the value is in upper case.
url(String? value, {String? message, List<String?> protocols = const ['http', 'https', 'ftp'], bool requireTld = true, bool requireProtocol = false, bool allowUnderscore = false, List<String> hostWhitelist = const [], List<String> hostBlacklist = const []}) String?
Check if the value is a valid URL. This check is more elaborate than the simple check. it checks if the URL is valid and if it is, it checks if the protocol is as expected, if the top level domain if specified matches and if underscores are allowed or not In addition the check also checks if the port is valid and you can specify whitelisted and backlisted hosts.