img<L, V> function
DomElement<L, V>
img<L, V>({
- String? key,
- List<
String> ? classes, - Map<
String, String> ? attributes, - Map<
String, String> ? styles, - String? accesskey,
- String? alt,
- String? autocapitalize,
- String? border,
- String? contenteditable,
- String? crossorigin,
- String? decoding,
- String? dir,
- String? draggable,
- String? height,
- String? id,
- bool? ismap,
- String? itemprop,
- String? lang,
- String? loading,
- String? referrerpolicy,
- String? role,
- String? sizes,
- String? slot,
- String? spellcheck,
- String? src,
- String? srcset,
- String? tabindex,
- String? title,
- String? translate,
- String? usemap,
- String? width,
- Map<
String, DomEventFn< ? events,L, V> > - DomLifecycleEventFn<
L> ? onCreate, - DomLifecycleEventFn<
L> ? onUpdate, - DomLifecycleEventFn<
L> ? onRemove, - Iterable<
DomNode< ? children,L, V> > - DomNode<
L, V> ? child, - 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,
);
}