Search packages, repositories and app categories

Package detailsv1.0.0+2

dynamic_treeview

A Dynamic treeview that can be build using dynamic parent/child relationship. It supports indefinite category/subcategory lists with horizontal and vertical scrolling

30-day downloads
7
Likes
47
Pub points
40

Install package

flutter pub add dynamic_treeview

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package for creating dynamic, interactive tree views with flexible parent-child relationships. It enables the construction of indefinite category and subcategory hierarchies, supporting both horizontal and vertical scrolling for large datasets. Ideal for organizing nested data structures like file systems, organizational charts, or product categories. The tree adapts dynamically to changes in data, ensuring smooth performance and scalability.

Use cases

  • Organizational charts
  • File system navigation
  • Product category trees
  • Nested data display
  • Dynamic filtering interfaces

Key features

  • Supports infinite nesting levels
  • Horizontal and vertical scroll support
  • Dynamic data binding
  • Customizable node styling
  • Efficient rendering for large datasets

Suitable for

  • Apps with hierarchical data
  • Complex UIs requiring expandable lists
  • Data-heavy applications
  • Custom tree-based navigation
  • Scalable UI components

Considerations

  • Requires careful state management
  • Performance may degrade with very deep trees
  • Limited platform-specific optimizations
  • No built-in search/filter functionality
  • Needs custom implementation for animations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

dynamic_treeview - A flutter package

A Dynamic treeview that can be build using dynamic parent/child relationship. It supports indefinite category/subcategory lists with horizontal and vertical scrolling

Getting Started

In your flutter project add the dependency:

    dependencies:
        ...
        dynamic_treeview: 1.0.0+2

Import package

import 'package:dynamic_treeview/dynamic_treeview.dart';

BaseModel implementation

    Since DynamicTreeView is build using data having parent/child relationship, 
    you must create a class model that implements BaseModel and overrides the method 
    like getParentId(), getId() and getTitle() and return appropriate values to make it work. 
    The method getExtraData() has also been added just in-case if any extra data is needed when child/parent is tapped.

Sample Usage

    DynamicTreeView(
        data: getData(), // pass here List<BaseModel>
        config: Config(
            parentTextStyle:
                TextStyle(color: Colors.black, fontWeight: FontWeight.w600),
            rootId: "1",
            parentPaddingEdgeInsets:
                EdgeInsets.only(left: 16, top: 0, bottom: 0)),
        onTap: (m) {
        //action on tap
        },
        width: MediaQuery.of(context).size.width,
    )

Constructor parameters

    data                -   List<BaseData> .TreeView will be build based on this data.This is a required field
    config              -   Various Configuration options
    onTap               -   Callback when tapped on parent/child widget

Configuration parameters

    parentTextStyle                 -   Parent tile TextStyle
    parentPaddingEdgeInsets         -   Parent tile padding
    childrenTextStyle               -   Child tile TextStyle
    childrenPaddingEdgeInsets       -   Children tile padding

Check the Config class in dynamic_treeview.dart file for details.

Sample code

Please check example for details.

Screenshots

Full Screen

alt text

Drawer

alt text

MIT LICENSE
I spent weeks of my time developing this package. I really hope this saves you loads of time and i'd be glad to hear your feedback.Let me know if you find any bugs/issues.Thanks.

Categories

Source repository

Projects using this package

No data available yet.