isDomainName static method

bool isDomainName(
  1. String s
)

Checks if the given string s is a domain name.

Will return false if the given string s starts with www. or *.

Implementation

static bool isDomainName(String s) {
  if (s.startsWith('*.') || isSubDomain(s)) {
    return false;
  }
  return parseDomain(s) != null;
}