ReferrerPolicy class Null safety

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>).


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


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


operator ==(Object value) bool
The equality operator. [...]

Static Properties

values Set<ReferrerPolicy>

Static Methods

fromValue(String? value) ReferrerPolicy?


NO_REFERRER → const ReferrerPolicy
The Referer header will not be sent.
const ReferrerPolicy._internal("no-referrer")
The Referer header will not be sent to origins without TLS (HTTPS).
const ReferrerPolicy._internal("no-referrer-when-downgrade")
ORIGIN → const ReferrerPolicy
The sent referrer will be limited to the origin of the referring page: its scheme, host, and port.
const ReferrerPolicy._internal("origin")
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.
const ReferrerPolicy._internal("origin-when-cross-origin")
SAME_ORIGIN → const ReferrerPolicy
A referrer will be sent for same origin, but cross-origin requests will contain no referrer information.
const ReferrerPolicy._internal("same-origin")
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).
const ReferrerPolicy._internal("strict-origin")
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).
const ReferrerPolicy._internal("strict-origin-when-cross-origin")
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.
const ReferrerPolicy._internal("unsafe-url")