Skip to main content

sai_nodes 1.0.0 copy "sai_nodes: ^1.0.0" to clipboard
sai_nodes: ^1.0.0 copied to clipboard

A lightweight, scalable, and highly customizable package for building interactive node-based UIs in Flutter.

sai_nodes #

Declarative graph editing in Flutter. This package renders the immutable sai_nodes_core document and delegates all persisted changes to its controller. It does not execute nodes or own application persistence.

import 'package:sai_nodes/sai_nodes.dart';

final definitions = NodeDefinitionRegistry()
  ..register(DeclarativeNodeDefinition(
    type: 'example.number',
    displayName: 'Number',
    ports: [StaticPortFamily([
      ResolvedPort(id: 'value', label: 'Value',
        direction: GraphPortDirection.output, kind: GraphPortKind.data,
        dataType: 'core.number'),
    ])],
  ));
final controller = GraphController(
  document: GraphDocument(id: 'document', spaces: {
    'main': GraphSpace(id: 'main', nodes: {
      'number': GraphNode(id: 'number', type: 'example.number', data: {'value': 42}),
    }),
  }),
  resolver: GraphResolver(definitions: definitions, types: GraphTypeSystem.core()),
);
// Place this widget inside a bounded Flutter layout:
final canvas = NodeEditor(controller: controller);
// The owner calls controller.dispose() when the document closes.

Default interactions cover selection, dragging, resizing, pan/zoom, connection creation/reconnection, waypoints, frames, comments, minimap and keyboard commands. Node/header/port/field builders share the default scene geometry. Optional host clipboard hooks preserve semantic dependencies through copy/paste/duplicate. An external GraphExecutionVisualSource supplies scoped activity and retained results without modifying the document or rebuilding cached node bodies.

Version 1.0 replaces the 0.x API and formats completely. See the repository example and docs/architecture.md for host integration and performance limits.

0
likes
130
points
53
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight, scalable, and highly customizable package for building interactive node-based UIs in Flutter.

Repository (GitHub)
View/report issues

Topics

#visual-scripting #workflow-editor #node-editor

License

MIT (license)

Dependencies

flutter, sai_nodes_core

More

Packages that depend on sai_nodes