DomainUtils class

Various utility functions for domains and suffixes.

This class holds utility functions to perform certain checks on domains and suffixes without having to first create PublicSuffix objects. Most of these functions create PublicSuffix objects internally, so if you already have such objects consider using the equivalent methods within PublicSuffix instead.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hasValidDomain(Uri domain, {bool icann = false, bool acceptDefaultRule = true}) bool
Checks if the URL contains a registrable domain part.
isKnownSuffix(String suffix, {SuffixRules? suffixRules}) bool
Checks if suffix is a known url suffix
isSubdomain(Uri potentialSub, {bool icann = false}) bool
Checks if a URL is a subdomain or a root domain.
isSubdomainOf(Uri potentialSub, Uri root, {bool icann = false}) bool
Checks if a URL is a subdomain of another.