quad&quot; address.

  &#47;&#47; Helper function for reporting a badly formatted IPv6 address.
  void error(String msg, [position]) {
    throw new FormatException(&#39;Illegal IPv6 address, $msg&#39;, host, position);
  }

  &#47;&#47; Parse a hex block.
  int parseHex(int start, int end) {
    if (end - start &gt; 4) {
      error(&#39;an IPv6 part can only contain a maximum of 4 hex digits&#39;, start);
    }
    int value = int.parse(host.substring(start, end), radix: 16);
    if (value &lt; 0 || value