PublicSuffix class
A description of the public suffix, root domain and registrable domain for a URL.
Constructors
- PublicSuffix({Uri? url, String? urlString, SuffixRules? suffixRules})
- Creates a new instance from a URL.
Properties
- domain → String?
-
Returns the registrable domain part of the URL, based on both ICANN/IANA and private rules.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- icannDomain → String?
-
Returns the registrable domain part of the URL, based on ICANN/IANA rules.
no setter
- icannRoot → String
-
Returns the root domain part of the URL, based on ICANN/IANA rules.
no setter
- icannSubdomain → String?
-
Returns the subdomain part of the URL, based on ICANN/IANA rules.
no setter
- icannSuffix → String
-
Returns the public suffix part of the URL, based on ICANN/IANA rules.
no setter
- punyDecoded → PublicSuffix
-
Returns a punycode decoded version of this object.
no setter
- root → String
-
Returns the root domain part of the URL, based on both ICANN/IANA and private rules.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceUrl → Uri
-
no setter
- subdomain → String?
-
Returns the subdomain part of the URL, based on both ICANN/IANA and private rules.
no setter
- suffix → String
-
Returns the public suffix part of the URL, based on both ICANN/IANA and private rules.
no setter
Methods
-
hasKnownSuffix(
) → bool - Whether the suffix is a known suffix or not.
-
hasValidDomain(
{bool icann = false, bool acceptDefaultRule = true}) → bool - Checks if the registrable domain is valid.
-
isPrivateSuffix(
) → bool - Checks if the URL was matched with a private rule rather than an ICANN/IANA rule.
-
isSubdomainOf(
PublicSuffix other, {bool icann = false}) → bool - Checks if this object represents a subdomain of another.
-
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
-
fromString(
String? url, {SuffixRules? suffixRules, Leniency leniency = Leniency.allowEmptyUrl}) → PublicSuffix? - An alternative to the default constructor with adjustable leniency for invalid URLs.
-
fromUrl(
Uri? url, {SuffixRules? suffixRules, Leniency leniency = Leniency.allowEmptyUrl}) → PublicSuffix? - An alternative to the default constructor with adjustable leniency for invalid URLs.