createVirtualNode method

VirtualNode? createVirtualNode(
  1. int rootId,
  2. int id,
  3. int pid,
  4. int index,
  5. String className,
  6. VoltronMap props,
)

Implementation

VirtualNode? createVirtualNode(
  int rootId,
  int id,
  int pid,
  int index,
  String className,
  VoltronMap props,
) {
  VirtualNode? node = context.renderManager.createVirtualNode(
    id,
    pid,
    index,
    className,
    props,
  );
  VirtualNode? parent = _virtualNodes[pid];
  // // Only text or text child need to create virtual node.
  if (className == NodeProps.kTextClassName) {
    node = TextVirtualNode(rootId, id, pid, index, context);
  } else if (className == NodeProps.kImageClassName && parent != null) {
    node = ImageVirtualNode(rootId, id, pid, index, context);
  }
  return node;
}