duplicate method

T? duplicate()

Duplicates this node, inserting it at parent.

Implementation

T? duplicate() {
  var parentRuntime = this.parentRuntime;
  var idx = indexInParent;
  if (idx < 0) return null;

  var copy = this.copy();
  parentRuntime!.insertAt(idx + 1, copy);

  return copy;
}