An open API service indexing awesome lists of open source software.

https://github.com/ajilo297/flutter_tree_view

A Flutter package to create an easily customisable Tree View
https://github.com/ajilo297/flutter_tree_view

dart flutter flutter-package tree treeview

Last synced: 4 months ago
JSON representation

A Flutter package to create an easily customisable Tree View

Awesome Lists containing this project

README

          

[![pub package](https://img.shields.io/badge/pub-0.0.5-orange.svg)](https://pub.dartlang.org/packages/tree_view)
[![Build Status](https://travis-ci.org/ajilo297/flutter_tree_view.svg?branch=master)](https://travis-ci.org/ajilo297/flutter_tree_view)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# Tree View
A Flutter package for a fully customisable tree view

### Installing
Add this to your `pubspec.yaml` file

```yaml
dependencies:
tree_view: ^0.0.5
```

And run
```sh
flutter packages get
```

### Example

Let's assume we want to show a tree view with this structure:

```
Desktop
|-- documents
| |-- Resume.docx
| |-- Billing-Info.docx
|-- MeetingReport.xls
|-- MeetingReport.pdf
|-- Demo.zip
```

In this example
1. `Resume.docx` and `Billing-Info.docx` are **Child** widgets with
`documents` as the **Parent**.
2. `documents`, `MeetingReport.xls`, `MeetingReport.xls` and `Demo.zip`
are **Child** widgets with `Desktop` as a **Parent** widget.

The `TreeView` would look like this

```dart
var treeView = TreeView(
parentList: [
Parent(
parent: Text('Desktop'),
childList: ChildList(
children: [
Parent(
parent: Text('documents'),
childList: ChildList(
children: [
Text('Resume.docx'),
Text('Billing-Info.docx'),
],
),
),
Text('MeetingReport.xls'),
Text('MeetingReport.pdf'),
Text('Demo.zip'),
],
),
),
],
);
```

#### Sample