img<L, V> function

DomElement<L, V> img<L, V>({
  1. String? key,
  2. List<String>? classes,
  3. Map<String, String>? attributes,
  4. Map<String, String>? styles,
  5. String? accesskey,
  6. String? alt,
  7. String? autocapitalize,
  8. String? border,
  9. String? contenteditable,
  10. String? crossorigin,
  11. String? decoding,
  12. String? dir,
  13. String? draggable,
  14. String? height,
  15. String? hidden,
  16. String? id,
  17. bool? ismap,
  18. String? itemprop,
  19. String? lang,
  20. String? loading,
  21. String? referrerpolicy,
  22. String? role,
  23. String? sizes,
  24. String? slot,
  25. String? spellcheck,
  26. String? src,
  27. String? srcset,
  28. String? tabindex,
  29. String? title,
  30. String? translate,
  31. String? usemap,
  32. String? width,
  33. Map<String, DomEventFn<L, V>>? events,
  34. DomLifecycleEventFn<L>? onCreate,
  35. DomLifecycleEventFn<L>? onUpdate,
  36. DomLifecycleEventFn<L>? onRemove,
  37. Iterable<DomNode<L, V>>? children,
  38. DomNode<L, V>? child,
  39. String? text,
})

Embeds an image into the document.

Implementation

DomElement<L, V> img<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,

  /// Alternative text in case an image can't be displayed.
  String? alt,

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

  /// The border width.
  ///
  ///
  /// Note: This is a legacy attribute. Please use the
  /// CSS border property instead.
  String? border,

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

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

  /// Indicates the preferred method to decode the image.
  String? decoding,

  /// 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,

  /// Specifies the height of elements listed here. For all other elements,
  /// use the CSS height property.
  ///
  ///
  ///
  /// Note: In some instances, such as
  /// <div>, this is a legacy attribute, in
  /// which case the CSS height property should
  /// be used instead.
  String? height,

  /// 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,

  /// Indicates that the image is part of a server-side image map.
  bool? ismap,

  ///
  String? itemprop,

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

  /// Indicates if the element should be loaded lazily
  /// (loading="lazy") or loaded immediately
  /// (loading="eager").
  String? loading,

  /// 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,

  ///
  String? sizes,

  /// 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,

  /// One or more responsive image candidates.
  String? srcset,

  /// 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,

  ///
  String? usemap,

  /// For the elements listed here, this establishes the element's width.
  ///
  ///
  /// Note: For all other instances, such as
  /// <div>, this is a legacy attribute, in
  /// which case the CSS width property should be
  /// used instead.
  String? width,
  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>(
    'img',
    key: key,
    classes: classes,
    attributes: <String, String>{
      if (accesskey != null) 'accesskey': accesskey,
      if (alt != null) 'alt': alt,
      if (autocapitalize != null) 'autocapitalize': autocapitalize,
      if (border != null) 'border': border,
      if (contenteditable != null) 'contenteditable': contenteditable,
      if (crossorigin != null) 'crossorigin': crossorigin,
      if (decoding != null) 'decoding': decoding,
      if (dir != null) 'dir': dir,
      if (draggable != null) 'draggable': draggable,
      if (height != null) 'height': height,
      if (hidden != null) 'hidden': hidden,
      if (id != null) 'id': id,
      if (ismap ?? false) 'ismap': 'ismap',
      if (itemprop != null) 'itemprop': itemprop,
      if (lang != null) 'lang': lang,
      if (loading != null) 'loading': loading,
      if (referrerpolicy != null) 'referrerpolicy': referrerpolicy,
      if (role != null) 'role': role,
      if (sizes != null) 'sizes': sizes,
      if (slot != null) 'slot': slot,
      if (spellcheck != null) 'spellcheck': spellcheck,
      if (src != null) 'src': src,
      if (srcset != null) 'srcset': srcset,
      if (tabindex != null) 'tabindex': tabindex,
      if (title != null) 'title': title,
      if (translate != null) 'translate': translate,
      if (usemap != null) 'usemap': usemap,
      if (width != null) 'width': width,
      ...?attributes,
    },
    styles: styles,
    events: events,
    onCreate: onCreate,
    onUpdate: onUpdate,
    onRemove: onRemove,
    children: children,
    child: child,
    text: text,
  );
}