$img function
Creates an img
node.
Implementation
DOMElement $img(
{Object? id,
Object? classes,
Object? style,
Map<String, String>? attributes,
String? src,
Future<String?>? srcFuture,
String? title,
Object? content,
bool? hidden,
bool commented = false}) {
var img = $tag('img',
id: id,
classes: classes,
style: style,
attributes: {
if (src != null) 'src': src,
if (title != null) 'title': title,
...?attributes
},
content: content,
hidden: hidden,
commented: commented);
if (srcFuture != null) {
srcFuture.then((src) {
if (src != null) {
img.setAttribute('src', src);
img.runtime.setAttribute('src', src);
}
return src;
});
}
return img;
}