build method

  1. @override
Object? build()
override

Builds this component's renderable output.

App code can return a node, another component, text, or an iterable of renderable values. The renderer normalizes the value internally.

Implementation

@override
View build() {
  return FlintElement(
    'span',
    props: mergeComponentProps(
      props,
      className: className,
      defaultStyle: const {'position': 'relative', 'display': 'inline-flex'},
      dartStyle: dartStyle,
      style: style,
    ),
    children: [
      toFlintNode(trigger),
      // Closed overlays must unmount instead of relying on `hidden`, so the
      // floating panel cannot keep stale geometry or interactive DOM around.
      if (open)
        FlintElement(
          'div',
          props: mergeComponentProps(
            {
              'role': 'dialog',
              'data-placement': placement,
            },
            className: panelClassName,
            defaultStyle: const {
              'position': 'absolute',
              'z-index': 30,
              'min-width': '220px',
              'padding': '12px',
              'border': '1px solid var(--color-surfaceBorder, #e4e7ec)',
              'border-radius': '8px',
              'background': 'var(--color-surface, #ffffff)',
              'color': 'var(--color-text, #0f172a)',
              'box-shadow': '0 12px 24px rgba(16, 24, 40, 0.14)',
            },
            dartStyle: panelDartStyle,
            style: panelStyle,
          ),
          children: normalizeChildren(child, children),
        ),
    ],
  );
}