DomainUtils class

Helper class for domain names

Constructors

DomainUtils()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

getDomainFromUrl(String url) Domain
Fetches the domain from the given url Returns null if the given url is not parsable.
isCCTLD(String s) → bool
Checks if the given string s is a cctld. Example : de => true com => false
isDomainName(String s) → bool
Checks if the given string s is a domain name. [...]
isGTLD(String s) → bool
Checks if the given string s is a gtld. Example : de => false com => true
isNGTLD(String s) → bool
Checks if the given string s is a ngtld. Example : car => true com => false de => false
isSubDomain(String s) → bool
Check if the given string s is a subdomain Example: api.domain.com => true domain.de.com => false
isSubDomainOf(String sub String domain) → bool
Checks if the given sub is a subdomain of the given domain. Example : sub1.domain.com & domain.com => true sub1.domain2.com & domain.com => false
isSubTld(String tld String subTld) → bool
Checks if the given string subTld is a subTld
isTld(String s) → bool
Checks if the given string s is a tld. Example : car => true com => true de => true qwertzu => false
parseDomain(String domainName) Domain
Parse the given domainName to a Domain object. Returns null if the given domainName is not parsable.
splitDomainName(String domainName) → List<String>
Splits the given domainName. Examples : example.com => "example","com" subdomain.example.com => "subdomain","example","com"
splitSubdomainInDomains(String name) → List<String>
Splits the given domain in seperate domain names for each subdomain. [...]