isIp static method

bool isIp(
  1. Map<String, dynamic> data,
  2. dynamic value,
  3. String args
)

check field is ip address

Implementation

static bool isIp(Map<String, dynamic> data, dynamic value, String args) {
  RegExp ipAddressRegex = RegExp(
    r'^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
  );
  return ipAddressRegex.hasMatch(value.toString());
}