toCountingText static method

String toCountingText(
  1. Iterable? iterable
)

Converts a list to a counting text.

Example: 1, 2, 3 -> '3'

Implementation

static String toCountingText(Iterable? iterable) {
  return iterable != null && iterable.isNotEmpty ? "${iterable.length}" : "0";
}