ResizeApi<T, C> extension

Resize operations for NodeFlowController.

This extension provides unified resize APIs that work for any resizable node, including GroupNode and CommentNode. The node must have Node.isResizable set to true.

Resize Lifecycle

  1. startResize - Captures original bounds and locks canvas
  2. updateResize - Calculates new bounds using absolute positioning
  3. endResize - Commits changes and unlocks canvas
  4. cancelResize - Reverts to original bounds and unlocks canvas

Example

// In a resize handle widget:
void _handleDragStart(DragStartDetails details) {
  controller.startResize(nodeId, ResizeHandle.bottomRight, details.globalPosition);
}

void _handleDragUpdate(DragUpdateDetails details) {
  controller.updateResize(details.globalPosition);
}

void _handleDragEnd(DragEndDetails details) {
  controller.endResize();
}
on

Methods

cancelResize() → void

Available on NodeFlowController<T, C>, provided by the ResizeApi extension

Cancels a resize operation and reverts to original position/size.
endResize() → void

Available on NodeFlowController<T, C>, provided by the ResizeApi extension

Ends the current resize operation.
startResize(String nodeId, ResizeHandle handle, Offset globalPosition) → void

Available on NodeFlowController<T, C>, provided by the ResizeApi extension

Starts a resize operation for any resizable node.
updateResize(Offset globalPosition) → void

Available on NodeFlowController<T, C>, provided by the ResizeApi extension

Updates the size of the currently resizing node during a resize operation.