script<L, V> function

DomElement<L, V> script<L, V>({
  1. String? key,
  2. List<String>? classes,
  3. Map<String, String>? attributes,
  4. Map<String, String>? styles,
  5. String? accesskey,
  6. bool? async,
  7. String? autocapitalize,
  8. String? contenteditable,
  9. String? crossorigin,
  10. bool? defer,
  11. String? dir,
  12. String? draggable,
  13. String? hidden,
  14. String? id,
  15. String? integrity,
  16. String? itemprop,
  17. String? lang,
  18. String? referrerpolicy,
  19. String? role,
  20. String? slot,
  21. String? spellcheck,
  22. String? src,
  23. String? tabindex,
  24. String? title,
  25. String? translate,
  26. String? type,
  27. Map<String, DomEventFn<L, V>>? events,
  28. DomLifecycleEventFn<L>? onCreate,
  29. DomLifecycleEventFn<L>? onUpdate,
  30. DomLifecycleEventFn<L>? onRemove,
  31. Iterable<DomNode<L, V>>? children,
  32. DomNode<L, V>? child,
  33. String? text,
})

Used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The

Implementation

DomElement<L, V> script<L, V>({
  String? key,
  List<String>? classes,
  Map<String, String>? attributes,
  Map<String, String>? styles,

  /// Keyboard shortcut to activate or add focus to the element.
  String? accesskey,

  /// Executes the script asynchronously.
  bool? async,

  /// Sets whether input is automatically capitalized when entered by user
  String? autocapitalize,

  /// Indicates whether the element's content is editable.
  String? contenteditable,

  /// How the element handles cross-origin requests
  String? crossorigin,

  /// Indicates that the script should be executed after the page has been
  /// parsed.
  bool? defer,

  /// Defines the text direction. Allowed values are ltr (Left-To-Right) or
  /// rtl (Right-To-Left)
  String? dir,

  /// Defines whether the element can be dragged.
  String? draggable,

  /// Prevents rendering of given element, while keeping child elements, e.g.
  /// script elements, active.
  String? hidden,

  /// Often used with CSS to style a specific element. The value of this
  /// attribute must be unique.
  String? id,

  /// Specifies a
  /// Subresource Integrity
  /// value that allows browsers to verify what they fetch.
  String? integrity,

  ///
  String? itemprop,

  /// Defines the language used in the element.
  String? lang,

  /// Specifies which referrer is sent when fetching the resource.
  String? referrerpolicy,

  /// Defines an explicit role for an element for use by assistive technologies.
  String? role,

  /// Assigns a slot in a shadow DOM shadow tree to an element.
  String? slot,

  /// Indicates whether spell checking is allowed for the element.
  String? spellcheck,

  /// The URL of the embeddable content.
  String? src,

  /// Overrides the browser's default tab order and follows the one specified
  /// instead.
  String? tabindex,

  /// Text to be displayed in a tooltip when hovering over the element.
  String? title,

  /// Specify whether an element's attribute values and the values of its
  /// Text node
  /// children are to be translated when the page is localized, or whether to
  /// leave them unchanged.
  String? translate,

  /// Defines the type of the element.
  String? type,
  Map<String, DomEventFn<L, V>>? events,
  DomLifecycleEventFn<L>? onCreate,
  DomLifecycleEventFn<L>? onUpdate,
  DomLifecycleEventFn<L>? onRemove,
  Iterable<DomNode<L, V>>? children,
  DomNode<L, V>? child,
  String? text,
}) {
  return DomElement<L, V>(
    'script',
    key: key,
    classes: classes,
    attributes: <String, String>{
      if (accesskey != null) 'accesskey': accesskey,
      if (async ?? false) 'async': 'async',
      if (autocapitalize != null) 'autocapitalize': autocapitalize,
      if (contenteditable != null) 'contenteditable': contenteditable,
      if (crossorigin != null) 'crossorigin': crossorigin,
      if (defer ?? false) 'defer': 'defer',
      if (dir != null) 'dir': dir,
      if (draggable != null) 'draggable': draggable,
      if (hidden != null) 'hidden': hidden,
      if (id != null) 'id': id,
      if (integrity != null) 'integrity': integrity,
      if (itemprop != null) 'itemprop': itemprop,
      if (lang != null) 'lang': lang,
      if (referrerpolicy != null) 'referrerpolicy': referrerpolicy,
      if (role != null) 'role': role,
      if (slot != null) 'slot': slot,
      if (spellcheck != null) 'spellcheck': spellcheck,
      if (src != null) 'src': src,
      if (tabindex != null) 'tabindex': tabindex,
      if (title != null) 'title': title,
      if (translate != null) 'translate': translate,
      if (type != null) 'type': type,
      ...?attributes,
    },
    styles: styles,
    events: events,
    onCreate: onCreate,
    onUpdate: onUpdate,
    onRemove: onRemove,
    children: children,
    child: child,
    text: text,
  );
}