ASCIIArtTree class
ASCII Art Tree generator.
Constructors
- ASCIIArtTree(Map tree, {String pathDelimiter = '/', String? stripPrefix, String? stripSuffix, ASCIIArtTreeStyle style = ASCIIArtTreeStyle.elegant, bool allowGraphs = false})
-
ASCIIArtTree.fromJson(Map<
String, dynamic> json, {String pathDelimiter = '/', String? stripPrefix, String? stripSuffix, ASCIIArtTreeStyle style = ASCIIArtTreeStyle.elegant, bool allowGraphs = false}) -
Constructs an ASCIIArtTree from a JSON Map.
factory
-
ASCIIArtTree.fromPaths(List<
List< paths, {String pathDelimiter = '/', String? stripPrefix, String? stripSuffix, ASCIIArtTreeStyle style = ASCIIArtTreeStyle.elegant, bool allowGraphs = false})String> > -
Constructs an ASCIIArtTree from a list of paths (already split).
See ASCIIArtTree.fromStringPaths.
factory
-
ASCIIArtTree.fromStringPaths(List<
String> paths, {Pattern delimiter = '/', List<String> splitter(String s)?, String blankRoot = '/', String? stripPrefix, String? stripSuffix, ASCIIArtTreeStyle style = ASCIIArtTreeStyle.elegant, bool allowGraphs = false}) -
Constructs an ASCIIArtTree from a list of paths, splitting
the paths by
delimiter
or using thesplitter
if provided. See ASCIIArtTree.fromPaths.factory
Properties
- allowGraphs → bool
-
If
true
, the tree will allow graphs. This means that each node in the tree is a global "key" (not a local node key), allowing multiple references to the same node.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
leaves
→ List<
String> -
Returns the leaves of the tree.
no setter
- pathDelimiter → String
-
The delimiter to use when joining nodes to represent a full path.
final
-
pathInfoProvider
↔ (String? Function(List<
String> parents, Map<String, dynamic> node, String key)?) -
If defined provides optional extra info
for each entry in the generated tree:
getter/setter pair
-
roots
→ List<
String> -
Returns the roots of the tree.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stripPrefix ↔ String?
-
Prefix to strip from each tree entry while generating the ASCII Art.
getter/setter pair
- stripSuffix ↔ String?
-
Suffix to strip from each tree entry while generating the ASCII Art.
getter/setter pair
- style ↔ ASCIIArtTreeStyle
-
The ASCII Art to generate.
getter/setter pair
- totalLeaves → int
-
Returns the total number of leaves in the tree.
no setter
- totalNodes → int
-
Computes and returns the total number of nodes in the tree.
no setter
- totalRoots → int
-
Returns the total number of roots in the tree.
no setter
-
tree
↔ Map<
String, dynamic> -
The tree.
getter/setter pair
Methods
-
generate(
{String indent = '', bool trim = false, ASCIIArtTreeStyle? style, bool expandGraphs = false}) → String - Generates the ASCII Art Tree.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → dynamic -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited