getRootPanelElement static method

KnowledgePanelElement? getRootPanelElement(
  1. Product product,
  2. String panelId
)

Returns the unique "root" panel element that matches panelId, or null.

Implementation

static KnowledgePanelElement? getRootPanelElement(
  Product product,
  String panelId,
) {
  final List<KnowledgePanelElement> elements = getRootPanelElements(
    product,
    panelId: panelId,
    simplified: false,
  );
  if (elements.length != 1) {
    return null;
  }
  return elements.first;
}