apply method

  1. @override
List<String> apply(
  1. Map<String, int> interactionCounts
)
override

Apply the rule to the analysis result Returns a list of widgets in their recommended order

Implementation

@override
List<String> apply(Map<String, int> interactionCounts) {
  final entries = interactionCounts.entries.toList();
  // Sort by count (descending)
  entries.sort((a, b) => b.value.compareTo(a.value));
  // Return widget IDs in order
  return entries.map((e) => e.key).toList();
}