buildLeaf method

TreeNode buildLeaf(
  1. StateKey key,
  2. StateCreator createState,
  3. StateDataCodec? codec, {
  4. bool isFinal = false,
})

Implementation

TreeNode buildLeaf(
  StateKey key,
  StateCreator createState,
  StateDataCodec? codec, {
  bool isFinal = false,
}) {
  assert(parentNode != null);
  var node = isFinal
      ? TreeNode(NodeType.finalLeafNode, key, parentNode!, createState, codec)
      : TreeNode(NodeType.leafNode, key, parentNode!, createState, codec);
  _addNode(node);
  return node;
}