collectionLabel static method
Builds the summary label shown for a collection.
Arrays report their element type when homogeneous:
Array of int[3], Array of mixed[2], Array[0].
Tables report their entry count: Table{2}.
Implementation
static String collectionLabel(Object? value) {
if (value is List) {
if (value.isEmpty) return 'Array[0]';
final first = typeName(value.first);
final homogeneous = value.every((e) => typeName(e) == first);
return 'Array of ${homogeneous ? first : 'mixed'}[${value.length}]';
}
if (value is Map) {
return value.isEmpty ? 'Table{}' : 'Table{${value.length}}';
}
return typeName(value);
}