treeify 0.0.1-nullsafety.2 copy "treeify: ^0.0.1-nullsafety.2" to clipboard
treeify: ^0.0.1-nullsafety.2 copied to clipboard

discontinuedreplaced by: console

A dart port of the treeify.js for creating trees or directory structures to be printed to console

treeify #

This is a port of the Javascript library treeify. Treeify converts maps into nice, visible depth-indented trees for console printing. The structure generated is similar to what you get by running the tree command on Unixy platforms.

{
    oranges: {
        'mandarin': {                                          ├─ oranges
            clementine: null,                                  │  └─ mandarin
            tangerine: 'so cheap and juicy!'        -=>        │     ├─ clementine
        }                                                      │     └─ tangerine: so cheap and juicy!
    },                                                         └─ apples
    apples: {                                                     ├─ gala
        'gala': null,                                             └─ pink lady
        'pink lady': null
    }
}

Getting Started #

Include the package:

  treeify: <latest_version>

Use the library by calling the static members on the exposed Tree class:

final testMap = {
  'oranges': null,
  'apples': true,
};
final tree = Treeify.asTree(testMap, false);

Differences #

I removed the hideFunctions from the tree as most dart Maps are usually not constructed with functions as keys.

1
likes
130
pub points
0%
popularity

Publisher

unverified uploader

A dart port of the treeify.js for creating trees or directory structures to be printed to console

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on treeify