allParameters property

List<Parameter> allParameters

Implementation

List<Parameter> get allParameters {
  if (_allParameters == null) {
    var recursedParameters = <Parameter>{};
    var newParameters = <Parameter>{};
    if (this is GetterSetterCombo &&
        (this as GetterSetterCombo).setter != null) {
      newParameters.addAll((this as GetterSetterCombo).setter.parameters);
    } else {
      if (isCallable) newParameters.addAll(parameters);
    }
    // TODO(jcollins-g): This part probably belongs in [ElementType].
    while (newParameters.isNotEmpty) {
      recursedParameters.addAll(newParameters);
      newParameters.clear();
      for (var p in recursedParameters) {
        var parameterModelType = p.modelType;
        if (parameterModelType is Callable) {
          newParameters.addAll(parameterModelType.parameters
              .where((pm) => !recursedParameters.contains(pm)));
        }
        if (parameterModelType is AliasedElementType) {
          newParameters.addAll(parameterModelType.aliasedParameters
              .where((pm) => !recursedParameters.contains(pm)));
        }
      }
    }
    _allParameters = recursedParameters.toList();
  }
  return _allParameters;
}