45 lines
1.2 KiB
Dart
45 lines
1.2 KiB
Dart
/*
|
|
* @Author: wangyang 1147192855@qq.com
|
|
* @Date: 2022-07-18 17:12:53
|
|
* @LastEditors: wangyang 1147192855@qq.com
|
|
* @LastEditTime: 2022-07-19 21:29:49
|
|
* @FilePath: \marking_app\lib\common\model\enum\subject.dart
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
enum Subject {
|
|
other, // 其他未定义
|
|
chineseLanguage, // 语文
|
|
mathematics, // 数学
|
|
english, // 英语
|
|
physical, // 物理
|
|
chemical, // 化学
|
|
biological, // 生物
|
|
political, // 政治
|
|
history, // 历史
|
|
geographic // 地理
|
|
}
|
|
|
|
const Map<Subject, String> subjectMap = {
|
|
Subject.chineseLanguage: '语文',
|
|
Subject.mathematics: '数学',
|
|
Subject.english: '英语',
|
|
Subject.physical: '物理',
|
|
Subject.chemical: '化学',
|
|
Subject.biological: '生物',
|
|
Subject.political: '政治',
|
|
Subject.history: '历史',
|
|
Subject.geographic: '地理'
|
|
};
|
|
|
|
String getSubjectEnumName(int index) {
|
|
String res = '';
|
|
try {
|
|
Subject theCurnt = Subject.values[index];
|
|
res = subjectMap[theCurnt] ?? res;
|
|
return res;
|
|
} catch (e) {
|
|
return '';
|
|
}
|
|
|
|
}
|