Accepted class
The Accepted Rule.
Validates that the field was "accepted" - useful for terms of service, agreement checkboxes, and similar boolean confirmations.
Usage
validate({
'terms': true,
'newsletter': 'yes',
}, {
'terms': [Accepted()],
});
Accepted Values
The following values are considered "accepted":
true(boolean)1(int)"1"(string)"yes"(case-insensitive)"on"(case-insensitive)"true"(case-insensitive)
Properties
Methods
-
message(
) → String -
Get the validation error message.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
params(
) → Map< String, dynamic> -
Get the replacement parameters for the message.
inherited
-
passes(
String attribute, dynamic value, Map< String, dynamic> data) → bool -
Determine if the validation rule passes.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited