RawNode.withKey constructor

RawNode.withKey(
  1. Node node
)

Implementation

factory RawNode.withKey(web.Node node) {
  return RawNode(
    node,
    key: switch (node) {
      web.Text() when node.instanceOfString("Text") => ValueKey('text'),
      web.Element() when node.instanceOfString("Element") => ValueKey('element:${node.tagName}'),
      _ => null,
    },
  );
}