previewKeys function
A short, sorted preview of keys for a summary line.
Implementation
String previewKeys(Iterable<String> keys, {int limit = 6}) {
final sorted = keys.toList()..sort();
if (sorted.length <= limit) return sorted.join(', ');
return '${sorted.take(limit).join(', ')}, … (${sorted.length - limit} more)';
}