String describeDirectory()

in lib/src/utils.dart [30:47]


String describeDirectory(String name, List<Descriptor> contents) {
  if (contents.isEmpty) return name;

  var buffer = StringBuffer();
  buffer.writeln(name);
  for (var entry in contents.take(contents.length - 1)) {
    var entryString = prefixLines(entry.describe(), '${glyph.verticalLine}   ',
        first: '${glyph.teeRight}${glyph.horizontalLine}'
            '${glyph.horizontalLine} ');
    buffer.writeln(entryString);
  }

  var lastEntryString = prefixLines(contents.last.describe(), '    ',
      first: '${glyph.bottomLeftCorner}${glyph.horizontalLine}'
          '${glyph.horizontalLine} ');
  buffer.write(lastEntryString);
  return buffer.toString();
}