getIterableType function

Future<IterableKind> getIterableType(
  1. DartType target,
  2. 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;
}