diff --git a/lib/pangea/analytics_details_popup/lemma_usage_dots.dart b/lib/pangea/analytics_details_popup/lemma_usage_dots.dart index aa4e78e83..6c4f90087 100644 --- a/lib/pangea/analytics_details_popup/lemma_usage_dots.dart +++ b/lib/pangea/analytics_details_popup/lemma_usage_dots.dart @@ -24,16 +24,19 @@ class LemmaUsageDots extends StatelessWidget { }); /// Find lemma uses for the given exercise type, to create dot list - List sortedUses(LearningSkillsEnum category) { - final List useList = []; + List sortedUses(LearningSkillsEnum category) { + final List useList = []; for (final OneConstructUse use in construct.cappedUses) { - if (use.xp == 0) { - continue; - } // If the use type matches the given category, save to list // Usage with positive XP is saved as true, else false if (category == use.useType.skillsEnumType) { - useList.add(use.xp > 0); + useList.add( + switch (use.xp) { + > 0 => AppConfig.success, + < 0 => Colors.red, + _ => Colors.grey[400]!, + }, + ); } } return useList; @@ -42,13 +45,13 @@ class LemmaUsageDots extends StatelessWidget { @override Widget build(BuildContext context) { final List dots = []; - for (final bool use in sortedUses(category)) { + for (final Color color in sortedUses(category)) { dots.add( Container( width: 15.0, height: 15.0, decoration: BoxDecoration( - color: use ? AppConfig.success : Colors.red, + color: color, shape: BoxShape.circle, ), ),