events property
Structured event system for handling various editor events.
Events are organized into logical groups (node, connection, viewport, etc.) for better discoverability and maintainability.
Example:
NodeFlowEditor(
controller: controller,
nodeBuilder: nodeBuilder,
theme: theme,
events: NodeFlowEvents(
node: NodeEvents(
onTap: (node) => handleNodeTap(node),
onDragStart: (node) => print('Dragging ${node.id}'),
),
viewport: ViewportEvents(
onCanvasTap: (pos) => clearSelection(),
),
connection: ConnectionEvents(
onBeforeComplete: (context) {
// Validate connections
return ConnectionValidationResult(allowed: true);
},
),
onInit: () => controller.fitToView(),
),
)
Implementation
final NodeFlowEvents<T>? events;