getOnlyCandidateFiles method

Future<List<File>> getOnlyCandidateFiles(
  1. List<FileSystemEntity> fileSytemEntities
)

Implementation

Future<List<File>> getOnlyCandidateFiles(
    List<FileSystemEntity> fileSytemEntities) async {
  List<File> candidateFiles = fileSytemEntities.whereType<File>().toList();
  return candidateFiles
      .where((file) => file.path.endsWith('.dart'))
      .where((file) =>
          !file.readAsLinesSync().any((line) => line.startsWith('part of')))
      .toList();
}