embed function

Component embed({
  1. required String src,
  2. String? type,
  3. int? width,
  4. int? height,
  5. Key? key,
  6. String? id,
  7. String? classes,
  8. Styles? styles,
  9. Map<String, String>? attributes,
  10. Map<String, EventCallback>? events,
})

The <embed> HTML element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.

  • src: The URL of the resource being embedded.
  • type: The MIME type to use to select the plug-in to instantiate.
  • width: The displayed width of the resource, in CSS pixels.
  • height: The displayed height of the resource, in CSS pixels.

Implementation

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