chore: add descriptions for analytics categories (#4100)

This commit is contained in:
ggurdin 2025-09-23 11:20:07 -04:00 committed by GitHub
parent e10f2bebeb
commit c4ccfee694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 6 deletions

View file

@ -5252,5 +5252,8 @@
"courseDesc": "Course description",
"courseSavedSuccessfully": "Course saved successfully",
"addCoursePlan": "Add a course plan",
"activityStatsButtonInstruction": "Click here to view your activity stats and to close the activity when finished"
"activityStatsButtonInstruction": "Click here to view your activity stats and to close the activity when finished",
"readingAnalyticsDesc": "Click practice on each message for reading activities.",
"speakingAnalyticsDesc": "Record voice messages for speaking practice.",
"audioAnalyticsDesc": "Click practice on each message for listening activities."
}

View file

@ -58,6 +58,8 @@ class LemmaUsageDots extends StatelessWidget {
? construct.lemmaCategory.color(context)
: construct.lemmaCategory.darkColor(context));
final description = category.description(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
@ -75,11 +77,20 @@ class LemmaUsageDots extends StatelessWidget {
),
const SizedBox(width: 8.0),
Flexible(
child: Wrap(
spacing: 3,
runSpacing: 5,
children: dots,
),
child: dots.isEmpty
? description != null
? Text(
description,
style: const TextStyle(
fontStyle: FontStyle.italic,
),
)
: const SizedBox()
: Wrap(
spacing: 3,
runSpacing: 5,
children: dots,
),
),
],
),

View file

@ -33,4 +33,17 @@ enum LearningSkillsEnum {
return "";
}
}
String? description(BuildContext context) {
switch (this) {
case LearningSkillsEnum.reading:
return L10n.of(context).readingAnalyticsDesc;
case LearningSkillsEnum.hearing:
return L10n.of(context).audioAnalyticsDesc;
case LearningSkillsEnum.speaking:
return L10n.of(context).speakingAnalyticsDesc;
default:
return null;
}
}
}