milestoneTitleLabel function

String milestoneTitleLabel(
  1. AppLocalizations l10n,
  2. int level
)

Localized headline for a milestone's mastery level.

Lives here rather than on Milestone because the entity is built inside a provider, where there is no BuildContext to resolve an AppLocalizations from.

Implementation

String milestoneTitleLabel(AppLocalizations l10n, int level) => switch (level) {
  5 => l10n.milestoneReachedMastery,
  4 => l10n.milestoneAdvancedEvaluation,
  3 => l10n.milestoneAdvancedApplication,
  2 => l10n.milestoneAdvancedUnderstanding,
  1 => l10n.milestoneStartedAwareness,
  _ => l10n.milestoneStartedStudying,
};