describeElements method Null safety

DiagnosticsNode describeElements(
  1. String name,
  2. Iterable<Element> elements
)

Returns a list of Elements from the current build context to the error report.

Implementation

static DiagnosticsNode describeElements(String name, Iterable<Element> elements) {
  return DiagnosticsBlock(
    name: name,
    children: elements.map<DiagnosticsNode>((Element element) => DiagnosticsProperty<Element>('', element)).toList(),
    allowTruncate: true,
  );
}