array_to_tree 0.1.0
array_to_tree: ^0.1.0 copied to clipboard

Convert a plain array into a Hierarchy List Ordered

ARRAY_TO_TREE #

Create any Multi Level Tree on your flutter app based on a Plain Array.

To use this please add in your pubspec.yaml #

dependencies:
  array_to_tree: ^0.1.0

To generate the hierarchy list, just call this.

var list = [
    {'id': 1, 'title': 'home', 'parent': null},
    {'id': 2, 'title': 'about', 'parent': null},
    {'id': 3, 'title': 'team', 'parent': 2},
    {'id': 4, 'title': 'company', 'parent': 2},
    {'id': 5, 'title': 'company', 'parent': 3}
  ];

buildTree() => _hierarchyTree = ArrayToTree.buildStaticTree(list);

DONE:

  • [x] Conversion of Plain Array into a List with n-level construction.

Special Thanks #

Contributing #

All contributions are welcome!

If you like this project then please click on the 🌟 it'll be appreciated or if you wanna add more epic stuff you can submit your pull request and it'll be gladly accepted 🙆‍♂️

6
likes
100
pub points
0%
popularity

Publisher

Unknown

Convert a plain array into a Hierarchy List Ordered

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_web_plugins

More

Packages that depend on array_to_tree