extractExportFrame function

Element? extractExportFrame(
  1. Element element
)

Extracts the ExportFrame as Element from the provided element. ExportFrame is identified by checking if the widget contains the exportFrameKey.

Implementation

Element? extractExportFrame(Element element) {
  if (element.widget.key == exportFrameKey) {
    return element;
  }

  List<Element> children = [];
  element.visitChildren((Element e) {
    children.add(e);
  });

  for (Element child in children) {
    Element? found = extractExportFrame(child);
    if (found != null) {
      return found;
    }
  }
  return null;
}