getBestPerformingProxies method

List<ProxyModel> getBestPerformingProxies({
  1. int count = 10,
})

Gets the best performing proxies based on their scores

Implementation

List<ProxyModel> getBestPerformingProxies({int count = 10}) {
  final allProxies =
      getAllProxies().where((proxy) => proxy.score != null).toList();

  // Sort by score (highest first)
  allProxies.sort((a, b) {
    final aScore = a.score?.calculateScore() ?? 0;
    final bScore = b.score?.calculateScore() ?? 0;
    return bScore.compareTo(aScore);
  });

  // Return the top N proxies
  return allProxies.take(count).toList();
}