a function

ElementNode a({
  1. Object? key,
  2. required String href,
  3. String? target,
  4. String? rel,
  5. bool download = false,
  6. String? classes,
  7. Map<String, String>? style,
  8. EventCallback? onClick,
  9. Map<String, Attribute>? attrs,
  10. 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,
  );
}