Skip to content

Installation

GitHub StarsPub VersionLicense

Get Vyuh Node Flow running in your Flutter project in under 5 minutes.

Requirements

RequirementMinimum Version
Flutter3.32.0+
Dart SDK3.9.0+

Setup

Add the Dependency

Add vyuh_node_flow to your pubspec.yaml. The current version is ^....

yaml
dependencies:
  vyuh_node_flow: ^0.19.0  # See pub.dev for latest version
yaml
dependencies:
  vyuh_node_flow:
    git:
      url: https://github.com/vyuh-tech/vyuh_node_flow.git
      path: packages/vyuh_node_flow

Run the install command:

bash
flutter pub get

Import the Library

Add the import to your Dart files:

dart
import 'package:vyuh_node_flow/vyuh_node_flow.dart';

Verify Installation

Create a minimal test to confirm everything works:

dart
import 'package:flutter/material.dart';
import 'package:vyuh_node_flow/vyuh_node_flow.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final controller = NodeFlowController<String, dynamic>();

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: NodeFlowEditor<String, dynamic>(
          controller: controller,
          theme: NodeFlowTheme.light,
          nodeBuilder: (context, node) => Center(child: Text(node.data)),
        ),
      ),
    );
  }
}

Run the app. If it compiles and runs without errors, you're ready to go.

INFO

Under the Hood: Vyuh Node Flow uses MobX for reactive state management. The package handles all MobX setup internally - no additional configuration needed.

What's Included

The vyuh_node_flow package exports everything you need:

Widgets

ExportPurpose
NodeFlowEditorThe main interactive editor widget with full editing capabilities
NodeFlowViewerRead-only display widget for presenting flows

State & Configuration

ExportPurpose
NodeFlowControllerCentral controller for state management, graph operations, and viewport control
NodeFlowConfigBehavioral configuration (grid snapping, zoom limits)
NodeFlowBehaviorPresets for editor modes: design, preview, present
NodeFlowEventsEvent callbacks for nodes, ports, connections, viewport, and annotations

Extensions

Additional features like minimap, autopan, debug overlays, level-of-detail (LOD), and statistics are managed via Extensions. Most extensions take direct parameters (e.g., MinimapExtension, DebugExtension, LodExtension), while AutoPanExtension accepts an AutoPanConfig object. See the Configuration guide for details.

Core Data Models

ExportPurpose
Node<T>Node with generic data type, position, size, and ports
PortConnection point with position, shape, and constraints
ConnectionLink between output and input ports with optional styling
ConnectionEndPointDefines connection endpoint markers (arrows, circles, etc.)
GroupNodeSpecial node for visually grouping other nodes
CommentNodeSpecial node for floating text annotations
GraphContainer for nodes and connections (used for serialization)

Theming

ExportPurpose
NodeFlowThemeRoot theme container
NodeThemeNode appearance (borders, colors, shadows)
ConnectionThemeConnection styling
PortThemePort appearance
LabelThemeConnection labels
GridThemeGrid background
SelectionThemeSelection rectangle
CursorThemeMouse cursors
ResizerThemeResize handles

Extension Themes

Themes for extensions like MinimapTheme and DebugTheme are configured via their respective extensions (e.g., MinimapExtension), not directly on NodeFlowTheme.

Visual Customization

ExportPurpose
ConnectionStylesPath algorithms (bezier, smoothstep, step, straight, customBezier)
ConnectionEffectAnimations (FlowingDashEffect, ParticleEffect, GradientFlowEffect, PulseEffect)
NodeShapeNode shapes (CircleShape, DiamondShape, HexagonShape)
MarkerShapePort shapes (circle, square, diamond, triangle, capsuleHalf, etc.)

Next Steps