nextSibling static method

LatexNode? nextSibling(
  1. LatexNode parent,
  2. LatexNode child
)

Gets the next sibling of a specified node within its parent's child list

Implementation

static LatexNode? nextSibling(LatexNode parent, LatexNode child) {
  final children = childrenOf(parent);
  final index = children.indexOf(child);
  return (index >= 0 && index < children.length - 1)
      ? children[index + 1]
      : null;
}