parseReactElement function

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

Implementation

StyledElement parseReactElement(dom.Element element,
    List<StyledElement> children,) {
  switch (element.localName) {
    case "a":
      if (element.attributes.containsKey('href')) {
        return ReactElement(
          name: element.localName!,
          children: children,
          href: element.attributes['href'],
          style: CSS3(
            color: Colors.blue,
            textDecoration: TextDecoration.underline,
          ),
          node: element,
          elementId: element.id,
        );
      }
      return StyledElement(
        name: element.localName!,
        children: children,
        style: CSS3(),
        node: element,
        elementId: element.id,
      );

  /// will never be called, just to suppress missing return warning
    default:
      return ReactElement(
        name: element.localName!,
        children: children,
        node: element,
        href: '',
        style: CSS3(),
        elementId: "[[No ID]]",
      );
  }
}