generateForAnnotatedElement method

  1. @override
String generateForAnnotatedElement(
  1. Element element,
  2. ConstantReader annotation,
  3. BuildStep buildStep
)

Outputs any sub generators with the exception of the adapter. The adapter should include code generated by this method.

Implementation

@override
String generateForAnnotatedElement(element, annotation, buildStep) {
  final generators = buildGenerators(element, annotation);

  return generators.fold<List<String>>(<String>[], (acc, generator) {
    acc.add(generator.generate());
    return acc;
  }).join('\n');
}