isValid method

  1. @override
bool isValid(
  1. dynamic value
)
override

Implementation

@override
bool isValid(dynamic value) {
  if (!super.isValid(value)) {
    return false;
  }
  switch (_format) {
    case Types.int:
      if (value is! int) {
        return false;
      }
      break;
    case Types.double:
      if (value is! double) {
        return false;
      }
      break;
    default:
      return false;
  }
  if (_min <= value && _max >= value) {
    return true;
  }
  return false;
}