RequiredRule<T> class
A Rule subclass validating if the input is notEmpty. If the Value is null, this rule fails. If the value if of type String and if the String is empty, this rule fails. If the value if of type Iterable or Map and if the value is empty, this rule fails.
Constructors
- RequiredRule({String? validationMessage})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transformMessage ↔ MessageTransformer?
-
A function used for transforming the message that comes back from the rules.
getter/setter pairinherited
- validationMessage → String?
-
A custom validation message to be used with the rule.
finalinherited
Methods
-
getRuleSpecificParams(
) → Map< String, String> -
Returns a Map of values that are specific to the child Rule.
inherited
-
isEmptyIterable(
dynamic value) → bool -
isEmptyMap(
dynamic value) → bool -
isEmptyString(
dynamic value) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onValidate(
String entityName, T? value) → String? -
Returns the validation message by the child class extending Rule.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
String entityName, T? value) → String? -
Returns validation message if validation fails.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited