generateScreenBindings function

Future<Set<String>> generateScreenBindings({
  1. String? fallbackDartSdkPath,
  2. required String templateFilePath,
  3. required Set<String> rootDirPaths,
  4. Set<String> subDirPaths = const {},
  5. Set<String> pathPatterns = const {},
})

Note: Returns all the annotated screen class names.

Implementation

Future<Set<String>> generateScreenBindings({
  String? fallbackDartSdkPath,
  required String templateFilePath,
  required Set<String> rootDirPaths,
  Set<String> subDirPaths = const {},
  Set<String> pathPatterns = const {},
}) async {
  Here().debugLogStart('Starting generator. Please wait...');
  final classNames = <String>{};
  await generateFromTemplates(
    fallbackDartSdkPath: fallbackDartSdkPath,
    rootDirPaths: rootDirPaths,
    subDirPaths: subDirPaths,
    pathPatterns: pathPatterns,
    templateFilePaths: {templateFilePath},
    generateForFile: (collection, filePath, templates, _) async {
      final temp = await _generateForFile(
        collection,
        filePath,
        templates,
      );
      classNames.addAll(temp);
    },
  );
  Here().debugLogStop('Done!');
  return classNames;
}