isIPv4 property

bool get isIPv4

Check if this is an IPv4 address

Implementation

bool get isIPv4 {
  // Check for IPv4-mapped IPv6: ::ffff:x.x.x.x
  return ip[10] == 0xff && ip[11] == 0xff &&
         ip.take(10).every((b) => b == 0);
}