tryInitRoot method

RenderNode? tryInitRoot(
  1. int instanceId
)

Implementation

RenderNode? tryInitRoot(int instanceId) {
  var viewModel = _context.getInstance(instanceId);
  if (viewModel != null) {
    var tree = _controllerRegistry.getRenderTree(instanceId);
    if (tree == null) {
      tree = RenderTree(instanceId, viewModel);
      _controllerRegistry.addRenderTree(tree);
    }

    var node = _controllerRegistry.getRenderNode(instanceId, instanceId);
    if (node == null) {
      node = RootRenderNode(instanceId, NodeProps.kRootNode, tree, this, null);
      tree.init(node);
    }

    return node;
  }

  return null;
}