TrustedTypePolicyFactory class Null safety

The interface of the Trusted Types API creates policies and allows the verification of Trusted Type objects against created policies.

Annotations

Constructors

TrustedTypePolicyFactory()
factory

Properties

defaultPolicy TrustedTypePolicy?
Returns the default TrustedTypePolicy or null if this is empty.
read-only
emptyHTML TrustedHTML
Returns a TrustedHTML object containing an empty string.
read-only
emptyScript TrustedScript
Returns a TrustedScript object containing an empty string.
read-only
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

createPolicy(String policyName, [TrustedTypePolicyOptions? policyOptions]) TrustedTypePolicy
Creates a TrustedTypePolicy object that implements the rules passed as policyOptions. var policy = TrustedTypePolicyFactory.createPolicy(policyName,policyOptions);
getAttributeType(String tagName, String attribute, [String? elementNs = '', String? attrNs = '']) String?
Allows web developers to check whether a Trusted Type is required for an element and attribute, and if so which one. var attributeType = TrustedTypePolicyFactory.getAttributeType(tagName,attribute,elementNs,attrNs);
getPropertyType(String tagName, String property, [String? elementNs = '']) String?
Allows web developers to check whether a Trusted Type is required for a property, and if so which one. var null = TrustedTypePolicyFactory.getPropertyType(tagName,property, elementNS);
isHTML(dynamic value) bool
When passed a value checks that it is a valid TrustedHTML object. var isHTML = TrustedTypePolicyFactory.isHTML(value);
isScript(dynamic value) bool
When passed a value checks that it is a valid TrustedScript object. var isScript = TrustedTypePolicyFactory.isScript(value);
isScriptURL(dynamic value) bool
When passed a value checks that it is a valid TrustedScriptURL object. var isScriptURL = TrustedTypePolicyFactory.isScriptURL(value);
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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