moveTo method

Future<NodeId> moveTo(
  1. NodeId nodeId,
  2. NodeId targetNodeId, {
  3. NodeId? insertBeforeNodeId,
})

Moves node into the new container, places it before the given anchor. nodeId Id of the node to move. targetNodeId Id of the element to drop the moved node into. insertBeforeNodeId Drop node before this one (if absent, the moved node becomes the last child of targetNodeId). Returns: New id of the moved node.

Implementation

Future<NodeId> moveTo(NodeId nodeId, NodeId targetNodeId,
    {NodeId? insertBeforeNodeId}) async {
  var result = await _client.send('DOM.moveTo', {
    'nodeId': nodeId,
    'targetNodeId': targetNodeId,
    if (insertBeforeNodeId != null) 'insertBeforeNodeId': insertBeforeNodeId,
  });
  return NodeId.fromJson(result['nodeId'] as int);
}