TreePrinter class

Prints a directory tree structure to the console with formatting.

This class builds a representation of files and directories in a tree format, with options for sorting, filtering, and displaying file sizes.

Constructors

TreePrinter.new({required List<String> ignorePatterns, bool showSizes = false, SortBy sortBy = SortBy.name, SortDirection sortDirection = SortDirection.ascending, int? maxLevel})
Creates a new TreePrinter with the specified options.

Properties

hashCode int
The hash code for this object.
no setterinherited
ignorePatterns List<String>
Patterns to ignore when processing files and directories.
final
maxLevel int?
Maximum directory depth to display (null means unlimited).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showSizes bool
Whether to show file and directory sizes.
final
sortBy SortBy
Criteria to use for sorting files and directories.
final
sortDirection SortDirection
Direction to sort files and directories.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printDirectoryTree(Directory directory, {String prefix = ''}) Future<void>
Prints the directory tree starting from the specified directory.
shouldSkipEntry(FileSystemEntity entry) bool
Determines if a file system entry should be skipped based on ignore patterns.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited