isIp function

bool isIp(
  1. String value,
  2. String type
)

Implementation

bool isIp(String value, String type) {
  var typeInt = type == 'v4'
      ? 4
      : type == 'v6'
          ? 6
          : 0;

  return validators.isIP(value, typeInt);
}