fluffychat/lib/pangea/analytics_summary/progress_indicators_enum.dart
wcjord d773347d6e
Morph-repo-2 (#1681)
* feat(morphs): repo for getting lang-specific list of morphs

* integrated repo into use of morph features and tags

* generated

* merged with previous push

* generated

* generated

* chore: fix .env file path

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
Co-authored-by: ggurdin <ggurdin@gmail.com>
2025-02-03 12:21:29 -05:00

65 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:fluffychat/pangea/analytics_misc/construct_type_enum.dart';
enum ProgressIndicatorEnum {
level,
wordsUsed,
morphsUsed,
}
extension ProgressIndicatorsExtension on ProgressIndicatorEnum {
IconData get icon {
switch (this) {
case ProgressIndicatorEnum.wordsUsed:
return Symbols.dictionary;
case ProgressIndicatorEnum.morphsUsed:
return Symbols.toys_and_games;
case ProgressIndicatorEnum.level:
return Icons.star;
}
}
IconData get iconSelected {
switch (this) {
case ProgressIndicatorEnum.wordsUsed:
return Symbols.dictionary;
case ProgressIndicatorEnum.morphsUsed:
return Symbols.toys_and_games;
case ProgressIndicatorEnum.level:
return Icons.star;
}
}
static bool isDarkMode(BuildContext context) =>
Theme.of(context).brightness == Brightness.dark;
Color color(BuildContext context) {
return Theme.of(context).colorScheme.primary;
}
String tooltip(BuildContext context) {
switch (this) {
case ProgressIndicatorEnum.wordsUsed:
return L10n.of(context).vocab;
case ProgressIndicatorEnum.level:
return L10n.of(context).level;
case ProgressIndicatorEnum.morphsUsed:
return L10n.of(context).grammar;
}
}
ConstructTypeEnum get constructType {
switch (this) {
case ProgressIndicatorEnum.wordsUsed:
return ConstructTypeEnum.vocab;
case ProgressIndicatorEnum.morphsUsed:
return ConstructTypeEnum.morph;
default:
return ConstructTypeEnum.vocab;
}
}
}