extractChineseEntries function

Future<List<String>> extractChineseEntries(
  1. List<String> directoriesToScan
)

Implementation

Future<List<String>> extractChineseEntries(
    List<String> directoriesToScan) async {
  List<String> entries = [];

  for (String dirPath in directoriesToScan) {
    Directory dir = Directory(dirPath);
    await for (FileSystemEntity entity
        in dir.list(recursive: true, followLinks: false)) {
      if (entity is File && entity.path.endsWith('.dart')) {
        String fileContent = await entity.readAsString();
        entries.addAll(findChineseEntriesInFile(fileContent));
      }
    }
  }

  final originalEntriesList = entries.toSet().toList();
  final filteredEntries = _dealWithResult(originalEntriesList);

  return filteredEntries.toSet().toList();
}