previousSibling static method

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

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

Implementation

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