RequiredRule class
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.
- Inheritance
-
- Object
- ValidationRule
- RequiredRule
Constructors
Properties
-
contextValues
→ Map<
String, dynamic> ? -
Provide the values from the data to the rule, null if none
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the validation rule.
This is used to identify the rule in validation logic.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
message(
dynamic value, [List< String> ? options]) → String -
The message that will be displayed if the validation fails.
This provides feedback to the user indicating that the field is required.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
dynamic value, [List< String> ? options]) → bool -
Validates the given value to check if it is not null and not empty.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited