buildDiagram function Null safety

void buildDiagram(
  1. {required DiagramBuilder builder,
  2. required Iterable<ClassElement> classElements,
  3. required bool excludeHasA,
  4. required bool excludeIsA,
  5. required bool excludePrivateClasses,
  6. required bool excludePrivateFields,
  7. required bool excludePrivateMethods,
  8. required Iterable<RegExp> excludes,
  9. required Iterable<RegExp> hasA,
  10. required Iterable<RegExp> includes,
  11. required Iterable<RegExp> isA,
  12. required bool verbose}
)

Build a diagram using the given builder from the given class elements.

Implementation

void buildDiagram({
  required DiagramBuilder builder,
  required Iterable<ClassElement> classElements,
  required bool excludeHasA,
  required bool excludeIsA,
  required bool excludePrivateClasses,
  required bool excludePrivateFields,
  required bool excludePrivateMethods,
  required Iterable<RegExp> excludes,
  required Iterable<RegExp> hasA,
  required Iterable<RegExp> includes,
  required Iterable<RegExp> isA,
  required bool verbose,
}) {
  final visitor = DiagramVisitor(
    onAggregateField: builder.addAggregation,
    onField: builder.addField,
    onEndClass: builder.endClass,
    onInterface: builder.addInterface,
    onMethod: builder.addMethod,
    onMixin: builder.addMixin,
    onBeginClass: builder.beginClass,
    onSuper: builder.addSuper,
    excludeHasA: excludeHasA,
    excludeIsA: excludeIsA,
    excludePrivateClasses: excludePrivateClasses,
    excludePrivateFields: excludePrivateMethods,
    excludePrivateMethods: excludePrivateMethods,
    excludes: excludes,
    hasA: hasA,
    includes: includes,
    isA: isA,
    verbose: verbose,
  );

  for (final element in classElements) {
    element.accept(visitor);
  }
}