ReferrerPolicy class

Class that represents a Referrer-Policy HTTP header. It could be used with ScriptHtmlTagAttributes and CSSLinkHtmlTagAttributes when fetching a resource <link> or a <script> (or resources fetched by the <script>).

Properties

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

Methods

isSupported() bool
Checks if the value is supported by the defaultTargetPlatform.
name() String
Gets the name of the value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toNativeValue() String?
Gets String native value if supported by the current platform, otherwise null.
toString() String
A string representation of this object.
override
toValue() String
Gets String value.

Operators

operator ==(Object value) bool
The equality operator.
override

Static Properties

values Set<ReferrerPolicy>
Set of all values of ReferrerPolicy.
final

Static Methods

asNameMap() Map<String, ReferrerPolicy>
Creates a map from the names of ReferrerPolicy values to the values.
byName(String? name) ReferrerPolicy?
Gets a possible ReferrerPolicy instance value with name name.
fromNativeValue(String? value) ReferrerPolicy?
Gets a possible ReferrerPolicy instance from a native value.
fromValue(String? value) ReferrerPolicy?
Gets a possible ReferrerPolicy instance from String value.

Constants

NO_REFERRER → const ReferrerPolicy
The Referer header will not be sent.
NO_REFERRER_WHEN_DOWNGRADE → const ReferrerPolicy
The Referer header will not be sent to origins without TLS (HTTPS).
ORIGIN → const ReferrerPolicy
The sent referrer will be limited to the origin of the referring page: its scheme, host, and port.
ORIGIN_WHEN_CROSS_ORIGIN → const ReferrerPolicy
The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path.
SAME_ORIGIN → const ReferrerPolicy
A referrer will be sent for same origin, but cross-origin requests will contain no referrer information.
STRICT_ORIGIN → const ReferrerPolicy
Only send the origin of the document as the referrer when the protocol security level stays the same (e.g. HTTPS -> HTTPS), but don't send it to a less secure destination (e.g. HTTPS -> HTTP).
STRICT_ORIGIN_WHEN_CROSS_ORIGIN → const ReferrerPolicy
Send a full URL when performing a same-origin request, but only send the origin when the protocol security level stays the same (e.g.HTTPS -> HTTPS), and send no header to a less secure destination (e.g. HTTPS -> HTTP).
UNSAFE_URL → const ReferrerPolicy
The referrer will include the origin and the path (but not the fragment, password, or username). This value is unsafe, because it leaks origins and paths from TLS-protected resources to insecure origins.