validators/string library

String Validators

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

Properties

emailRegex RegExp
final
uuidRegex RegExp
final

Functions

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