list method

void list(
  1. Iterable<String> items, {
  2. String? title,
  3. LogLevel level = cli.LogLevel.info,
  4. bool newParagraph = false,
})

List Guidelines

Use when displaying a list of items. Uses info log level.

Format:

<Optional header>
 • <Item 1>
 • ...

Example:

Follow these steps:
 • first step
 • second step

Implementation

void list(
  final Iterable<String> items, {
  final String? title,
  final cli.LogLevel level = cli.LogLevel.info,
  final bool newParagraph = false,
}) {
  if (title != null) {
    _logger.log(
      title,
      level,
      type: cli.TextLogType.normal,
      newParagraph: newParagraph,
    );
  }

  items.forEachIndexed((final i, final item) {
    _logger.log(
      item,
      level,
      type: cli.TextLogType.bullet,
      newParagraph: i == 0 && newParagraph && title == null,
    );
  });
}