parseInteractableElement function

InteractableElement parseInteractableElement(
  1. Element element,
  2. List<StyledElement> children
)

Implementation

InteractableElement parseInteractableElement(
    dom.Element element, List<StyledElement> children) {
  switch (element.localName) {
    case "a":
      return InteractableElement(
        name: element.localName!,
        children: children,
        href: element.attributes['href'],
        style: Style(
          color: Colors.blue,
          textDecoration: TextDecoration.underline,
        ),
        node: element,
        elementId: element.id
      );
    /// will never be called, just to suppress missing return warning
    default:
      return InteractableElement(
        name: element.localName!,
        children: children,
        node: element,
        href: '',
        style: Style(),
        elementId: "[[No ID]]"
      );
  }
}