call method

  1. @override
String? call(
  1. num? value
)
override

Implementation

@override
String? call(num? value) {
  if (value == null) return null;
  if (min != null && value < min!) {
    return resolveBoundsError(
      BoundsViolation.belowMin,
      () => 'Should be higher than $min',
    );
  }
  if (max != null && value > max!) {
    return resolveBoundsError(
      BoundsViolation.aboveMax,
      () => 'Should be lower than $max',
    );
  }
  return null;
}