createSession property

DragSession Function()? createSession
final

Factory function to create a DragSession for this element.

When provided, ElementScope manages the session lifecycle:

Elements manage their own business state (positions, sizes) internally. The session purely handles canvas lock coordination.

Example:

ElementScope(
  createSession: () => controller.createSession(),
  onDragStart: (_) => controller.startNodeDrag(nodeId),
  onDragUpdate: (details) => controller.moveNodeDrag(details.delta),
  onDragEnd: (_) => controller.endNodeDrag(),
  // ... other callbacks
)

Implementation

final DragSession Function()? createSession;