source function

Component source({
  1. String? type,
  2. String? src,
  3. Key? key,
  4. String? id,
  5. String? classes,
  6. Styles? styles,
  7. Map<String, String>? attributes,
  8. Map<String, EventCallback>? events,
})

The <source> HTML element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. It is an empty element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats.

  • type: The MIME media type of the resource, optionally with a codecs parameter.

  • src: Address of the media resource.

    Required if the source element's parent is an <audio> and <video> element, but not allowed if the source element's parent is a <picture> element.

Implementation

Component source(
    {String? type,
    String? src,
    Key? key,
    String? id,
    String? classes,
    Styles? styles,
    Map<String, String>? attributes,
    Map<String, EventCallback>? events}) {
  return DomComponent(
    tag: 'source',
    key: key,
    id: id,
    classes: classes,
    styles: styles,
    attributes: {
      ...attributes ?? {},
      if (type != null) 'type': type,
      if (src != null) 'src': src,
    },
    events: events,
  );
}