customItem method

void customItem(
  1. String content, {
  2. required bool focused,
  3. String? leadingGlyph,
  4. bool highlighted = false,
})

Writes an item line with custom leading glyph.

Useful for tree structures, icons, or other custom prefixes.

Implementation

void customItem(
  String content, {
  required bool focused,
  String? leadingGlyph,
  bool highlighted = false,
}) {
  final arrow = lb.arrow(focused);
  final glyph = leadingGlyph != null ? '$leadingGlyph ' : '';
  final line = '$arrow $glyph$content';
  highlightedLine(line, highlighted: highlighted && focused);
}