object function

Component object(
  1. List<Component> children, {
  2. String? data,
  3. String? name,
  4. String? type,
  5. int? width,
  6. int? height,
  7. Key? key,
  8. String? id,
  9. String? classes,
  10. Styles? styles,
  11. Map<String, String>? attributes,
  12. Map<String, EventCallback>? events,
})

The <object> HTML element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.

  • data: The address of the resource as a valid URL. At least one of data and type must be defined.
  • name: The name of valid browsing context (HTML5).
  • type: The content type of the resource specified by data. At least one of data and type must be defined.
  • width: The width of the displayed resource in CSS pixels.
  • height: The height of the displayed resource in CSS pixels.

Implementation

Component object(List<Component> children,
    {String? data,
    String? name,
    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: 'object',
    key: key,
    id: id,
    classes: classes,
    styles: styles,
    attributes: {
      ...attributes ?? {},
      if (data != null) 'data': data,
      if (name != null) 'name': name,
      if (type != null) 'type': type,
      if (width != null) 'width': '$width',
      if (height != null) 'height': '$height',
    },
    events: events,
    children: children,
  );
}