* fix: fix dart formatting for CI * fix: sorted imports, updated deprecated flutter functions * fix: format files * fix: format files * feat: replace syncfusion flutter package with excel flutter package * fix: don't run enable google services patch in CI * fix: update iOS supported platforms for enable ios build script * fix: commented out linux build in integrate CI
45 lines
1.2 KiB
Dart
45 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
enum VocabProficiencyEnum { low, medium, high, unk }
|
|
|
|
extension Copy on VocabProficiencyEnum {
|
|
String toolTipString(BuildContext context) {
|
|
switch (this) {
|
|
case VocabProficiencyEnum.low:
|
|
return L10n.of(context).low;
|
|
case VocabProficiencyEnum.medium:
|
|
return L10n.of(context).medium;
|
|
case VocabProficiencyEnum.high:
|
|
return L10n.of(context).high;
|
|
case VocabProficiencyEnum.unk:
|
|
return L10n.of(context).unknownProficiency;
|
|
}
|
|
}
|
|
|
|
IconData get iconData {
|
|
switch (this) {
|
|
case VocabProficiencyEnum.low:
|
|
return Icons.sentiment_dissatisfied_outlined;
|
|
case VocabProficiencyEnum.medium:
|
|
return Icons.sentiment_neutral_outlined;
|
|
case VocabProficiencyEnum.high:
|
|
return Icons.sentiment_satisfied_outlined;
|
|
case VocabProficiencyEnum.unk:
|
|
return Icons.question_mark_outlined;
|
|
}
|
|
}
|
|
}
|
|
|
|
class VocabProficiencyUtil {
|
|
static VocabProficiencyEnum proficiency(num numeric) {
|
|
if (numeric > 1) {
|
|
return VocabProficiencyEnum.high;
|
|
}
|
|
if (numeric < -1) {
|
|
return VocabProficiencyEnum.low;
|
|
}
|
|
return VocabProficiencyEnum.medium;
|
|
}
|
|
}
|