getIterableElementType function

DartType? getIterableElementType(
  1. DartType dartType
)

Returns the element type of dartType, assuming it implements Iterable.

Returns null otherwise.

Implementation

DartType? getIterableElementType(DartType dartType) => dartType is InterfaceType
    ? dartType.lookUpInheritedGetter('single')?.returnType
    : null;