collectCustomTypeWithMethods function

List<AstCustomType> collectCustomTypeWithMethods(
  1. List<Method> methods
)

Implementation

List<AstCustomType> collectCustomTypeWithMethods(List<Method> methods) {
  final astTypes = <AstCustomType>[];
  for (final method in methods) {
    for (final element in method.parameters) {
      final l = element.type.realType().recursiveCustomType();
      if (l.isNotEmpty) {
        astTypes.addAll(l);
      }
    }

    final l = method.returnType.realType().recursiveCustomType();
    if (l.isNotEmpty) {
      astTypes.addAll(l);
    }
  }
  return astTypes;
}