undo method

void undo({
  1. bool deleteOnly = false,
  2. bool silent = false,
})

Implementation

void undo({bool deleteOnly = false, bool silent = false}) {
  if ( !deleteOnly )
    // Remove this command and all previous commands from the stack
    stack?.removeUpToAndIncluding(this);

  // remove from parent

  if ( parent != null) {
    parent!.children.remove(this);

    if (parent!.children.isEmpty)
      parent!.undo(silent: silent, deleteOnly: deleteOnly);
  }
}