Skip to content
pubscout

graphview

1.5.1, released a year ago by nabilmh.com

Display data in graph structures like trees, directed graphs, and layered layouts.

WASM-ready
$ flutter pub add graphview
Source repository

What it does

GraphView is used to display data in various graph structures including tree layouts, directed graphs, and layered graphs. It supports multiple layout algorithms such as Balloon, Circular, Radial, Tidier Tree, and Mindmap, along with node animations and expand/collapse functionality.

AI-written summary of version 1.5.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display family trees, hierarchical views, or organization charts.
  • You want to render directed graphs using force-directed or multilayer layouts.
  • You require interactive graph navigation with node expand and collapse support.

Skip it when

  • You are building standard data charts like line, bar, or pie charts.
  • You need to handle extremely large graph datasets with high performance demands.

Strengths

  • Multiple layout algorithms including Tree, Directed, Layered, Balloon, Circular, and Mindmap.
  • Includes node animations, expand/collapse functionality, and programmatic camera controls.
  • Works well with standard Flutter interactive widgets like InteractiveViewer.

Weaknesses

  • Designed primarily to work excellent with small graphs.
  • Requires manual setup with a zoom engine like InteractiveViewer for best experience.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
class TreeViewPage extends StatefulWidget {
  @override
  _TreeViewPageState createState() => _TreeViewPageState();
}

class _TreeViewPageState extends State<TreeViewPage> {
  final GraphViewController controller = GraphViewController();
  final Graph graph = Graph()..isTree = true;
  BuchheimWalkerConfiguration builder = BuchheimWalkerConfiguration();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: GraphView.builder(
        graph: graph,
        algorithm: BuchheimWalkerAlgorithm(builder, TreeEdgeRenderer(builder)),
        controller: controller,
        builder: (Node node) {
          var a = node.key.value as int;
          return Text('Node $a');
        },
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace graphview.