execute method
Implementation
@override
String? execute(Map<String, dynamic> context, Map<String, dynamic>? params) {
Map<String, dynamic> state = context['state'] ?? {};
int score = state['score'] ?? 0;
List<int> sortedThresholds = scoreRanges.keys.toList()..sort((a, b) => b.compareTo(a));
for (int threshold in sortedThresholds) {
if (score >= threshold) {
return scoreRanges[threshold];
}
}
return defaultNode;
}