MultipleOf<T extends num> class
Validates that a value is a multiple of the specified divisor.
Uses a floating-point-safe algorithm: divides input by divisor and
checks whether the quotient is within _epsilon of a whole number. The
naive input % divisor == 0 check fails for decimal divisors such as
0.1 due to IEEE-754 rounding (e.g. 0.3 % 0.1 is not exactly 0).
- Implemented types
-
- Validator<
T>
- Validator<
Constructors
- MultipleOf(T divisor)
Properties
Methods
-
call(
num input) → bool -
override
-
multipleOf(
num input, num divisor) → bool -
Returns
trueifinputis a multiple ofdivisor. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override