AbstractRuleBuilder<E> class
Holds a list of rules to match against
Constructors
- AbstractRuleBuilder({bool useKeyAsElementName = false, dynamic expression(E e)?, required String key})
Properties
- expression → dynamic Function(E e)?
-
The expression to get the result for the rule check
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
final
-
rules
→ List<
ValidationResult Function(dynamic)> -
The list of rules to check against
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useKeyAsElementName → bool
-
final
Methods
-
empty(
{String? message}) → AbstractRuleBuilder - Checks if the object a string and is empty
-
equal(
dynamic obj, {dynamic objNameOrValue, String? message}) → AbstractRuleBuilder - Checks if the object is equal to another one
-
greaterThan(
int max, {String? message}) → AbstractRuleBuilder - Checks if the object is a number and is greater than another number
-
greaterThanOrEqual(
int max, {String? message}) → AbstractRuleBuilder - Checks if the object is a number and is greater or equal to another number
-
isNull(
{String? message}) → AbstractRuleBuilder - Checks if the object is null
-
isRegex(
String pattern, {String? message}) → AbstractRuleBuilder - Checks if the object matches a regular expression
-
isValidEmailAddress(
{String? message}) → AbstractRuleBuilder - Checks the object is a String and is a valid email address
-
isValidNationalInsuranceNumber(
{String? message}) → AbstractRuleBuilder - Checks the object is a String and is a valid UK national insurance number
-
isValidPhoneNumber(
{String? message}) → AbstractRuleBuilder - Checks the object is a String and is a valid phone number
-
isValidUKPostCode(
{String? message}) → AbstractRuleBuilder - Checks the object is a String and is a valid UK post code
-
length(
int min, int max, {String? message}) → AbstractRuleBuilder - Checks if the object is a String and is inbetween two lengthes
-
lessThan(
int min, {String? message}) → AbstractRuleBuilder - Checks if the object is a number and is less than another value
-
lessThanOrEqual(
int min, {String? message}) → AbstractRuleBuilder - Checks if the object is a number and is less than or equal another value
-
maxLength(
int max, {String? message}) → AbstractRuleBuilder - Checks if the object is a String and is at below a maximum length
-
minLength(
int min, {String? message}) → AbstractRuleBuilder - Checks if the object is a String and is at least a minimum length
-
must(
bool validator(dynamic dyn), String? message, {String? code}) → AbstractRuleBuilder - Creates a new rule, passing in an expression and a message and returning a boolean
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notEmpty(
{String? message}) → AbstractRuleBuilder - Checks if the object a string and is not empty
-
notEqual(
dynamic obj, {String? message}) → AbstractRuleBuilder - Checks if the object is not equal to another one
-
notNull(
{String? message}) → AbstractRuleBuilder - Checks if the object is not null
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited