validation library

Validation helpers and rules for Routed.

Import this when you need access to the validator, rule definitions, or validation errors without pulling the entire framework barrel.

Classes

AbstractValidationRule
AcceptedRule
Validation rule that checks if the value is considered "accepted".
ActiveUrlRule
AfterOrEqualRule
AfterRule
Validation rule that checks if a date is after a given date.
AllowedMimeTypesRule
A validation rule that checks if the file's MIME type is allowed.
AlphaDashRule
AlphaNumRule
AlphaRule
AsciiRule
BeforeOrEqualRule
BeforeRule
BetweenRule
BooleanRule
ConfirmedRule
ContainsRule
ContextAwareValidationRule
DateEqualsRule
DateFormatRule
Validation rule that checks if a date matches a given format.
DateRule
DecimalRule
DifferentRule
DigitsBetweenRule
DigitsRule
DistinctRule
DoesntEndWithRule
DoesntStartWithRule
DoubleRule
EmailRule
EndsWithRule
FileBetweenRule
FileDimensionsRule
FileExtensionsRule
FileRule
A validation rule that checks if the given value is a file.
GreaterThanOrEqualRule
GreaterThanRule
HexColorRule
InArrayRule
InRule
The InRule class is a validation rule that checks if a given value is within a specified list of allowed values.
IntRule
A validation rule that checks if a given value is an integer.
IpRule
Validation rule that checks if the value is a valid IP address.
Ipv4Rule
Validation rule that checks if the value is a valid IPv4 address.
Ipv6Rule
Validation rule that checks if the value is a valid IPv6 address.
JsonRule
Validation rule that checks if the value is a valid JSON string.
LessThanOrEqualRule
LessThanRule
ListRule
LowercaseRule
MaxFileSizeRule
A validation rule that checks if the file size does not exceed a specified limit.
MaxLengthRule
A validation rule that checks if the length of a given string does not exceed a specified maximum length.
MaxRule
A validation rule that checks if the provided value does not exceed a specified maximum value.
MinLengthRule
A validation rule that checks if the length of a given string meets a specified minimum length.
MinRule
A validation rule that ensures a given value meets a specified minimum value.
MultipleOfRule
NotInRule
NotRegexRule
NullableRule
A validation rule that allows null values. It effectively removes any other validation rules if the value is null. This rule should be listed first if you want to allow nulls.
NumericRule
A validation rule that checks if a given value is numeric.
RequiredArrayKeysRule
RequiredRule
A validation rule that checks if a value is present and not empty. This rule is used to ensure that a field is not left blank.
SameRule
SameSizeRule
SlugRule
A validation rule that checks if a given value is a valid slug.
StartsWithRule
StringRule
A validation rule that checks if a given value is a valid string.
UlidRule
UppercaseRule
UrlRule
A validation rule that checks if a given value is a valid URL.
UuidRule
A validation rule that checks if a given value is a valid UUID (Universally Unique Identifier).
ValidationError
Represents a validation error in the engine.
ValidationRule
WordRule
A validation rule that checks if a given value is a valid word.

Functions

parseRules(Map<String, String> rules) Map<String, List<RuleWithOptions>>
Parses a map of string rules into a structured format.

Typedefs

RuleWithOptions = ({List<String>? options, ValidationRule rule})
A type definition for a validation rule with optional parameters.
ValidationRuleFactory = ValidationRule Function()