EditorInitApi<T> extension
Editor initialization API for NodeFlowController.
This extension provides the canonical initialization entry point for the NodeFlow editor. ALL initialization happens here - this is the "Big Bang" moment that sets up the entire universe of the editor.
Design Principles
-
Single Entry Point:
_initControlleris THE ONLY place where initialization occurs. No scattered initialization across multiple files. -
Predictable Order: All setup happens in a specific, documented order. This eliminates timing-related bugs where components depend on each other.
-
Private to Editor: This API is internal - only NodeFlowEditor can call it. External code cannot interfere with initialization.
-
Idempotent: Calling
_initControllermultiple times is safe - it only initializes once.
Initialization Order
- Theme setup
- Node shape builder setup
- Spatial index callbacks (portSizeResolver, nodeShapeBuilder)
- Connection painter creation
- Connection hit tester setup
- Render order provider setup
- Connection segment calculator storage
- Spatial index reactions setup
- Event handlers setup
- Initial spatial index rebuild (handles pre-loaded nodes)
- on
Properties
- isEditorInitialized → bool
-
Available on NodeFlowController<
Whether the controller has been initialized for editor use.T> , provided by the EditorInitApi extensionno setter
Methods
-
internalInitController(
{required NodeFlowTheme theme, required Size portSizeResolver(Port port), NodeShape? nodeShapeBuilder(Node< T> node)?, bool Function(Connection connection, Offset point)? connectionHitTesterBuilder(ConnectionPainter painter)?, List<Rect> connectionSegmentCalculator(Connection connection)?, NodeFlowEvents<T> ? events}) → void -
Available on NodeFlowController<
Initializes the controller for use with the NodeFlow editor.T> , provided by the EditorInitApi extension -
internalUpdateEvents(
NodeFlowEvents< T> events) → void -
Available on NodeFlowController<
Updates the event handlers on an already-initialized controller.T> , provided by the EditorInitApi extension -
internalUpdateNodeShapeBuilder(
NodeShape? builder(Node< T> node)?) → void -
Available on NodeFlowController<
Updates the node shape builder on an already-initialized controller.T> , provided by the EditorInitApi extension -
internalUpdateTheme(
NodeFlowTheme theme) → void -
Available on NodeFlowController<
Updates the theme on an already-initialized controller.T> , provided by the EditorInitApi extension