annotations/validations 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 is alpha
isAlphanumeric(String str) bool
check if the string is alphanumeric
isAscii(String str) bool
check if the string is ascii
isBase64(String str) bool
check if a string str 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
isDateRange(String? str, [dynamic min, dynamic max]) bool
isDivisibleBy(String str, dynamic n) bool
check if the string str is a number that's divisible by another
isEmail(String str) bool
check if the string str is an email
isFloat(String str) bool
check if the string str is a float
isFQDN(String str, {bool requireTld = true, bool allowUnderscores = false}) bool
check if the string str 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 hexadecimal
isHexColor(String str) bool
check if the string str 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 str is an integer
isIP(String? str, [dynamic version]) bool
check if the string str is IP version 4 or 6
isISBN(String? str, [dynamic version]) bool
check if the string is an ISBN (version 10 or 13)
isJSON(String str) bool
check if the string is valid JSON
isLength(String str, int min, [int? max]) bool
check if the length of the string str falls in a range
isLowerCase(String str) bool
check if the string str 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
isName(String str) bool
check if the string str contains only letters or spaces or periods
isNull(String? str) bool
check if the string str is null
isNumeric(String str) bool
bool check if the string is numeric
isPostalCode(String? text, String locale, {bool orElse()?}) bool
isSurrogatePair(String str) bool
check if the string contains any surrogate pairs chars
isUpperCase(String str) bool
check if the string str is uppercase
isURL(String? str, {List<String?> protocols = const ['http', 'https', 'ftp', 'ftps', 'file', 'git'], bool requireTld = true, bool requireProtocol = false, bool allowUnderscore = false, List<String> hostWhitelist = const [], List<String> hostBlacklist = const []}) bool
check if the string str 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, String pattern) bool
check if string str matches the pattern.
merge(Map? obj, Map? defaults) Map
shift<T>(List<T> l) → T?