push method

void push(
  1. PNDelegate delegate,
  2. dynamic data
)

Adds node and make it as a parent for next operations.

Consider tree:

       S1
      /  \
     S2  S3

if S2 is current node, then call to this method will result in adding node S4 as shown below, from this moment S4 is parent for next operation (in contrast to addChild)

       S1
      /  \
     S2  S3
    /
   S4

so calling it again will result in adding S5.

       S1
      /  \
     S2  S3
    /
   S4
  /
 S5

Implementation

void push(PNDelegate delegate, dynamic data) {
  var node = ProcessingNode(delegate, [], data);
  _current.children.add(node);
  _parenthood[node] = _current;
  _current = node;
}