a function
ElementNode
a(
{ - Object? key,
- required String href,
- String? target,
- String? rel,
- bool download = false,
- String? classes,
- Map<String, String>? style,
- EventCallback? onClick,
- Map<String, Attribute>? attrs,
- Children children = const [],
})
Implementation
ElementNode a({
Object? key,
required String href,
String? target,
String? rel,
bool download = false,
String? classes,
Map<String, String>? style,
EventCallback? onClick,
Map<String, Attribute>? attrs,
Children children = const [],
}) {
return el(
'a',
key: key,
classes: classes,
style: style,
onClick: onClick,
attrs: {
'href': StringAttribute(href),
if (target != null) 'target': StringAttribute(target),
if (rel != null) 'rel': StringAttribute(rel),
if (download) 'download': BooleanAttribute(true),
...?attrs,
},
children: children,
);
}