MaxSelected<T extends Iterable<G> , G> class
A validation rule that checks if the number of selected items in an iterable does not exceed a maximum limit.
This rule validates that the number of selected items in the input iterable does not exceed the specified maximum limit.
- Inheritance
-
- Object
- ValidationRule<
T> - MaxSelected
Constructors
- MaxSelected(int max, {String? message})
- Creates a new instance of the MaxSelected validation rule.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- l10n → ValidatorLocalizations
-
The ValidatorLocalizations instance used for localization of validation messages.
It's obtained through a service locator (
sl
) for convenience.no setterinherited - max → int
-
The maximum allowed number of selected items.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
message(
String fieldName) → String -
Retrieves the validation message to be displayed.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
T? value, Map< String, FormFieldState> fields) → bool -
Validates the given
value
against the validation rule.override -
validatorMessage(
String fieldName) → String -
Retrieves the validator message for the field.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited