NodeFlowExtension<T> class abstract interface

Interface for extensions that can observe and react to graph events.

Extensions are purely additive - they observe events and provide additional capabilities without modifying core behavior.

Lifecycle

  1. Extension is created
  2. attach is called with the controller reference
  3. onEvent is called for each graph event
  4. detach is called when the extension is removed

Example Implementation

class LoggingExtension<T> implements NodeFlowExtension<T> {
  NodeFlowController<T>? _controller;

  @override
  String get id => 'logging';

  @override
  void attach(NodeFlowController<T> controller) {
    _controller = controller;
    print('Logging extension attached');
  }

  @override
  void detach() {
    _controller = null;
    print('Logging extension detached');
  }

  @override
  void onEvent(GraphEvent event) {
    print('Event: $event');
  }
}

Usage

final controller = NodeFlowController<MyData>();
controller.addExtension(LoggingExtension<MyData>());

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for this extension.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(covariant dynamic controller) → void
Called when the extension is attached to a controller.
detach() → void
Called when the extension is detached from the controller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onEvent(GraphEvent event) → void
Called when a graph event occurs.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited