Validator class
A utility class for validating email addresses, URLs, and IP addresses.
Constructors
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
-
alphanumeric(
String input, {bool withSpace = false}) → bool -
Validates whether the given
input
is alphanumeric. -
americanExpressCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid American Express card number. -
anyCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid card number for any type. -
dateFormatDDMMYYYY(
String str) → bool - Validate string as a date.
-
dateFormatYYYYMMDD(
String str) → bool - Validate string as a date.
-
digits(
String input, {bool decimal = false, bool whole = false, bool fractions = false}) → bool -
Validates whether the given
input
contains only digits. -
dinersClubCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid Diners Club card number. -
discoverCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid Discover card number. -
email(
String email) → bool -
Validates whether the given
email
is a valid email address. -
ipAddress(
String ip) → bool -
Validates whether the given
ip
is a valid IP address. -
jcbCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid JCB card number. -
masterCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid MasterCard number. -
moderatePassword(
String password) → bool -
Validates whether the given
password
is moderate according to a predefined pattern. -
url(
String url) → bool -
Validates whether the given
url
is a valid URL. -
username(
String str) → bool - Validate string as a username.
-
visaCard(
String cardNumber) → bool -
Validates whether the given
cardNumber
is a valid Visa card number.