getIterableType function
Future<IterableKind>
getIterableType(
- DartType target,
- SubjectGenContext<Element> context
)
Implementation
Future<IterableKind> getIterableType(
DartType target, SubjectGenContext<Element> context) async {
var typeTree = getTypeTree(target);
if (_listChecker.isAssignableFromType(target) && typeTree.base.isDartCoreList) {
return IterableKind.list;
}
if (_setChecker.isAssignableFromType(target) && typeTree.base.isDartCoreSet) {
return IterableKind.set;
}
if (_iterableChecker.isAssignableFromType(target) && typeTree.base.isDartCoreIterable) {
return IterableKind.list;
}
return IterableKind.none;
}