prepareRuntimeHints method

List<RuntimeHintEntry> prepareRuntimeHints(
  1. List<ClassDeclaration> components
)
inherited

Prepares runtime hint entries by scanning declarations.

Implementation

List<RuntimeHintEntry> prepareRuntimeHints(
  List<ClassDeclaration> components,
) {
  final hints = <RuntimeHintEntry>[];

  for (final decl in components) {
    final superName = decl.getSuperClass()?.getName();
    if (superName == 'RuntimeHint' || superName == 'RuntimeHintProvider') {
      hints.add(
        RuntimeHintEntry(
          qualifiedName: decl.getQualifiedName(),
          name: decl.getName(),
          type: superName == 'RuntimeHintProvider' ? 'provider' : 'direct',
        ),
      );
    }
  }

  return hints;
}