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

  1. Single Entry Point: _initController is THE ONLY place where initialization occurs. No scattered initialization across multiple files.

  2. Predictable Order: All setup happens in a specific, documented order. This eliminates timing-related bugs where components depend on each other.

  3. Private to Editor: This API is internal - only NodeFlowEditor can call it. External code cannot interfere with initialization.

  4. Idempotent: Calling _initController multiple times is safe - it only initializes once.

Initialization Order

  1. Theme setup
  2. Node shape builder setup
  3. Spatial index callbacks (portSizeResolver, nodeShapeBuilder)
  4. Connection painter creation
  5. Connection hit tester setup
  6. Render order provider setup
  7. Connection segment calculator storage
  8. Spatial index reactions setup
  9. Event handlers setup
  10. Initial spatial index rebuild (handles pre-loaded nodes)
on

Properties

isEditorInitialized bool

Available on NodeFlowController<T>, provided by the EditorInitApi extension

Whether the controller has been initialized for editor use.
no 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<T>, provided by the EditorInitApi extension

Initializes the controller for use with the NodeFlow editor.
internalUpdateEvents(NodeFlowEvents<T> events) → void

Available on NodeFlowController<T>, provided by the EditorInitApi extension

Updates the event handlers on an already-initialized controller.
internalUpdateNodeShapeBuilder(NodeShape? builder(Node<T> node)?) → void

Available on NodeFlowController<T>, provided by the EditorInitApi extension

Updates the node shape builder on an already-initialized controller.
internalUpdateTheme(NodeFlowTheme theme) → void

Available on NodeFlowController<T>, provided by the EditorInitApi extension

Updates the theme on an already-initialized controller.