ScriptHtmlTagAttributes class

Class that represents the possible the <script> HTML attributes to be set used by PlatformInAppWebViewController.injectJavascriptFileFromUrl.

Constructors

ScriptHtmlTagAttributes({String type = "text/javascript", String? id, bool? async, bool? defer, CrossOrigin? crossOrigin, String? integrity, bool? noModule, String? nonce, ReferrerPolicy? referrerPolicy, Function? onLoad, Function? onError})

Properties

async ↔ bool?
For classic scripts, if the async attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available.
getter/setter pair
crossOrigin ↔ CrossOrigin?
Normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard CORS checks. To allow error logging for sites which use a separate domain for static media, use this attribute.
getter/setter pair
defer ↔ bool?
This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id ↔ String?
The HTML id attribute is used to specify a unique id for the <script> HTML element.
getter/setter pair
integrity ↔ String?
This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation.
getter/setter pair
noModule ↔ bool?
This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code.
getter/setter pair
nonce ↔ String?
A cryptographic nonce (number used once) to whitelist scripts in a script-src Content-Security-Policy. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.
getter/setter pair
onError ↔ Function?
Represents a callback function that will be called if an error occurred while trying to load the script.
getter/setter pair
onLoad ↔ Function?
Represents a callback function that will be called as soon as the script has been loaded successfully.
getter/setter pair
referrerPolicy ↔ ReferrerPolicy?
Indicates which referrer to send when fetching the script, or resources fetched by the script.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type ↔ String
This attribute indicates the type of script represented. The value of this attribute will be in one of the following categories. The default value is text/javascript.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts instance to a map.
toMap() → Map<String, dynamic>
Converts instance to a map.
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromMap(Map<String, dynamic>? map) → ScriptHtmlTagAttributes?
Gets a possible ScriptHtmlTagAttributes instance from a Map value.