Integer class
The Integer Rule.
Validates that the field is an integer, an integer-looking string, or a
double with no fractional part. Mirrors Laravel's integer rule
(FILTER_VALIDATE_INT), which passes a float like 5.0 because PHP casts
it to the string "5" before filtering; a Dart double gets the same
answer here by checking it against its own truncated value instead.
Usage
validate(data, {
'quantity': [Required(), Integer()],
});
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