HtmlElementView.fromTagName constructor

HtmlElementView.fromTagName({
  1. Key? key,
  2. required String tagName,
  3. bool isVisible = true,
  4. ElementCreatedCallback? onElementCreated,
})

Creates a platform view that creates a DOM element specified by tagName.

isVisible indicates whether the view is visible to the user or not. Setting this to false allows the rendering pipeline to perform extra optimizations knowing that the view will not result in any pixels painted on the screen.

onElementCreated is called when the DOM element is created. It can be used by the app to customize the element by adding attributes and styles. This method is called before the element is attached to the DOM.

Implementation

factory HtmlElementView.fromTagName({
  Key? key,
  required String tagName,
  bool isVisible = true,
  ElementCreatedCallback? onElementCreated,
}) =>
    HtmlElementViewImpl.createFromTagName(
      key: key,
      tagName: tagName,
      isVisible: isVisible,
      onElementCreated: onElementCreated,
    );