validators/string library

String Validators

This file contains validators for checking the format and content of strings.

Functions

isDate() IValidator
Checks whether the given value is a valid DateTime formatted String
isDoubleString() IValidator
Validates that the String can be parsed as a double (e.g. '123.45', '-1e3')
isEmail() IValidator
Validates that the String is a valid email address.
isEmpty() IValidator
isIntString() IValidator
Validates that the String can be parsed as an int (e.g. '123', '-42')
isLowerCase() IValidator
Validates that it's a String and it's lowecase
isNotEmpty() IValidator
Checks whether the given value is not empty
isNumString() IValidator
Validates that the String can be parsed as a num (int or double)
isStrictUrl() IValidator
isUpperCase() IValidator
Validates that it's a String and it's uppercase
isUrl({bool strict = false}) IValidator
Validates that the String is a valid URL. By it uses non-strict validation (like "example.com").
isUuidV4() IValidator
Validates that the String is a valid UUID (v4).
stringContains(String str) IValidator
Validates that the String contains str
stringEmpty<T>() IValidator
Validate that it's a String and the string is empty
stringIsOfLength(int size) IValidator
Validates that the String's length is the same as the provided size
stringLength(List<IValidator> validators) IValidator
Validates that the String's length matches the validators
stringMatchesPattern(Pattern pattern, {String? error}) IValidator
Validates that the String matches the provided pattern