validator library

Functions

contains(String str, dynamic seed) bool
check if the string contains the seed
equals(String str, dynamic comparison) bool
check if the string matches the comparison
isAfter(String str, [dynamic date]) bool
check if the string is a date that's after the specified date [...]
isAlpha(String str) bool
check if the string contains only letters (a-zA-Z).
isAlphanumeric(String str) bool
check if the string contains only letters and numbers
isAscii(String str) bool
check if the string contains ASCII chars only
isBase64(String str) bool
check if a string is base64 encoded
isBefore(String str, [dynamic date]) bool
check if the string is a date that's before the specified date [...]
isByteLength(String str, int min, [int max]) bool
check if the string's length (in bytes) falls in a range.
isCreditCard(String str) bool
check if the string is a credit card
isDate(String str) bool
check if the string is a date
isDivisibleBy(String str, dynamic n) bool
check if the string is a number that's divisible by another [...]
isEmail(String str) bool
check if the string is an email
isFloat(String str) bool
check if the string is a float
isFQDN(dynamic str, [dynamic options]) bool
check if the string is a fully qualified domain name (e.g. domain.com). [...]
isFullWidth(String str) bool
check if the string contains any full-width chars
isHalfWidth(String str) bool
check if the string contains any half-width chars
isHexadecimal(String str) bool
check if the string is a hexadecimal number
isHexColor(String str) bool
check if the string is a hexadecimal color
isIn(String str, dynamic values) bool
check if the string is in a array of allowed values
isInt(String str) bool
check if the string is an integer
isIP(String str, [dynamic version]) bool
check if the string is an IP (version 4 or 6) [...]
isISBN(String str, [dynamic version]) bool
check if the string is an ISBN (version 10 or 13)
isLength(String str, int min, [int max]) bool
check if the string's length falls in a range [...]
isLowercase(String str) bool
check if the string is lowercase
isMongoId(String str) bool
check if the string is a valid hex-encoded representation of a MongoDB ObjectId
isMultibyte(String str) bool
check if the string contains one or more multibyte chars
isNull(String str) bool
check if the string is null
isNumeric(String str) bool
check if the string contains only numbers
isSurrogatePair(String str) bool
check if the string contains any surrogate pairs chars
isUppercase(String str) bool
check if the string is uppercase
isURL(String str, [Map options]) bool
check if the string is a URL [...]
isUUID(String str, [dynamic version]) bool
check if the string is a UUID (version 3, 4 or 5).
isVariableWidth(String str) bool
check if the string contains a mixture of full and half-width chars
matches(String str, dynamic pattern) bool
check if string matches the pattern.