script function

ElementNode script({
  1. String? src,
  2. bool async = false,
  3. bool defer = false,
  4. String? type,
  5. String? content,
})

Implementation

ElementNode script({
  String? src,
  bool async = false,
  bool defer = false,
  String? type,
  String? content,
}) {
  return el(
    'script',
    attrs: {
      if (src != null) 'src': StringAttribute(src),
      if (type != null) 'type': StringAttribute(type),
      if (async) 'async': BooleanAttribute(true),
      if (defer) 'defer': BooleanAttribute(true),
    },
    children: content != null ? [text(content)] : const [],
  );
}