EqualToRule class
A validation rule that checks if a value is equal to a target value.
- Inheritance
-
- Object
- ValidatorRule
- EqualToRule
Constructors
- EqualToRule(num target, {String? errorMessage})
-
Creates an EqualToRule with the given
targetvalue and an optionalerrorMessage.const
Properties
-
defaultMessage
→ Map<
String, String> -
Provides default error messages in multiple languages.
no setteroverride
- errorMessage → String?
-
The error message to be displayed if validation fails.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- target → num
-
The target value that the input should be equal to.
final
Methods
-
isValid(
BuildContext context, String? value) → String? -
Validates if the
valueis equal to the target.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited