generateSubject method

  1. @override
FutureOr<void> generateSubject(
  1. SubjectGenContext<Element> genContext,
  2. SubjectCodeContext codeContext
)

Implementation

@override
FutureOr<void> generateSubject(SubjectGenContext<Element> genContext,
    SubjectCodeContext codeContext) async {
  codeContext.additionalImports
      .add(AliasImport.gen("package:dogs_core/dogs_core.dart"));

  try {
    for (var element in genContext.matches) {
      if (element is ClassElement) {
        await generateForClass(element, genContext, codeContext);
      } else if (element is EnumElement) {
        await generateForEnum(element, genContext, codeContext);
      }
    }
  } catch (e, s) {
    print("$e: $s");
  }
}