NodeFlowPlugin class abstract

Interface for plugins that add behavior and state to the node flow editor.

Plugins are purely additive - they observe events and provide additional capabilities without modifying core behavior. Each plugin manages its own state and reacts to graph events.

Lifecycle

  1. Plugin is created with its configuration
  2. attach is called with the controller reference
  3. onEvent is called for each graph event
  4. detach is called when the plugin is removed

Example Implementation

class LoggingPlugin extends NodeFlowPlugin {
  NodeFlowController? _controller;

  @override
  String get id => 'logging';

  @override
  void attach(NodeFlowController controller) {
    _controller = controller;
    print('Logging plugin attached');
  }

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

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

Usage

final controller = NodeFlowController<MyData>();
controller.addPlugin(LoggingPlugin());
Implementers

Constructors

NodeFlowPlugin()

Properties

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

Methods

attach(NodeFlowController controller) → void
Called when the plugin is attached to a controller.
detach() → void
Called when the plugin 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