hierarchyString method

String hierarchyString([
  1. int indent = 0
])

Returns a pretty-print String of the heirarchy of all Modules within this Module.

Implementation

String hierarchyString([int indent = 0]) {
  final padding = List.filled(indent, '  ').join();
  final hier = StringBuffer('$padding> ${toString()}');

  for (final module in _subModules) {
    hier.write('\n${module.hierarchyString(indent + 1)}');
  }
  return hier.toString();
}