tree_view_view 1.0.2 copy "tree_view_view: ^1.0.2" to clipboard
tree_view_view: ^1.0.2 copied to clipboard

A powerful and flexible tree view package for Flutter with drag-and-drop, animations, and customizable indentation guides.

My Tree View Package #

A powerful and flexible Flutter package for displaying hierarchical data in tree structures.

Features #

  • 🌳 Dynamic Tree Rendering - Works with any data structure
  • 🎨 Customizable Indentation - Multiple guide styles (connecting lines, scoping lines, blank)
  • ✨ Smooth Animations - Animated expand/collapse transitions
  • β˜‘οΈ Checkbox Selection - Multi-select with Select All/Unselect All support
  • 🎯 Drag & Drop Support - Full drag and drop functionality with auto-scroll
  • πŸš€ High Performance - Lazy rendering with slivers
  • πŸ” Search Functionality - Built-in tree search with direct/indirect matching
  • πŸ“¦ Generic Type Support - Works with any node type
  • πŸŽͺ Dropdown Support - Tree structure in dropdown form with multi-select

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  my_tree_view_package: ^1.0.0

Quick Start #

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

class MyNode {
  const MyNode({required this.title, this.children = const []});
  final String title;
  final List<MyNode> children;
}

class MyTreeView extends StatefulWidget {
  @override
  State<MyTreeView> createState() => _MyTreeViewState();
}

class _MyTreeViewState extends State<MyTreeView> {
  late final TreeController<MyNode> treeController;

  @override
  void initState() {
    super.initState();
    treeController = TreeController<MyNode>(
      roots: [
        MyNode(title: 'Root', children: [
          MyNode(title: 'Child 1'),
          MyNode(title: 'Child 2'),
        ]),
      ],
      childrenProvider: (node) => node.children,
    );
  }

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

  @override
  Widget build(BuildContext context) {
    return TreeView<MyNode>(
      treeController: treeController,
      nodeBuilder: (context, entry) {
        return ListTile(
          title: Text(entry.node.title),
          onTap: () => treeController.toggleExpansion(entry.node),
        );
      },
    );
  }
}

Documentation #

See the example directory for comprehensive usage examples.

License #

MIT License

0
likes
150
points
156
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful and flexible tree view package for Flutter with drag-and-drop, animations, and customizable indentation guides.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, shadcn_flutter

More

Packages that depend on tree_view_view