getMostRecentlyUsedProxies method

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

Gets the most recently used proxies

Implementation

List<ProxyModel> getMostRecentlyUsedProxies({int count = 10}) {
  final allProxies = getAllProxies();

  // Sort by last used timestamp (most recent first)
  allProxies.sort((a, b) {
    final aLastUsed = a.score?.lastUsed ?? 0;
    final bLastUsed = b.score?.lastUsed ?? 0;
    return bLastUsed.compareTo(aLastUsed);
  });

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