getIterableElementType function
DartType?
getIterableElementType(
- DartType dartType,
- LibraryElement lib
Returns the element type of dartType
, assuming it implements Iterable
.
Returns null otherwise.
Implementation
DartType? getIterableElementType(DartType dartType, LibraryElement lib) =>
dartType is InterfaceType
? dartType.lookUpGetter2('single', lib)?.returnType
: null;