-
Notifications
You must be signed in to change notification settings - Fork 37
feat: 优化了体育查询界面的UI与部分代码逻辑 #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the sports score query interface with improved UI presentation and conditional logic for incomplete data. The changes focus on making the score display more informative and visually polished.
Changes:
- Added logic to display "Unknown" rank instead of "Unqualified" when four-year score data is incomplete (less than 4 records)
- Redesigned score card UI with labeled containers for total score and rank using color-coded backgrounds
- Added i18n support for new "Total Score" and "Rank" labels across three languages (English, Simplified Chinese, Traditional Chinese)
- Fixed formatting issues in README.md and configuration files
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/page/sport/sport_score_window.dart | Core logic and UI changes for sports score display, including new helper methods and restructured card layouts |
| assets/flutter_i18n/zh_CN.yaml | Added Simplified Chinese translations for "total_score_label" and "rank_label" |
| assets/flutter_i18n/zh_TW.yaml | Added Traditional Chinese translations for "total_score_label" and "rank_label" |
| assets/flutter_i18n/en_US.yaml | Added English translations for "total_score_label" and "rank_label" |
| README.md | Removed misaligned align="middle" attributes and added missing closing </div> tag |
| .vscode/settings.json | Removed trailing comma in JSON configuration |
| .gitignore | Changed .fvm/flutter_sdk to .fvm/ to ignore entire fvm directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
| } | ||
|
|
||
| bool isQualified = !sportScore.value.rank.contains("不"); |
Copilot
AI
Jan 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for determining if a score is qualified uses string matching with contains("不") (checking if the rank contains the Chinese character for "not"). This approach is fragile and not internationalized. If the application supports multiple languages (which it does based on the i18n files), this logic will break when the UI language is not Chinese. Consider using a more robust method such as checking against an enum or constant value, or parsing the rank field in a language-independent way.
| /// 获取单年成绩的显示颜色和背景 | ||
| Map<String, dynamic> _getScoreDisplayInfo() { | ||
| bool isQualified = !toUse.rank.contains("不"); |
Copilot
AI
Jan 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same internationalization issue exists here. The logic uses contains("不") to determine qualification status, which will fail when the application is in English or Traditional Chinese mode. This duplicates the same problematic pattern from the total score method. Consider extracting this logic into a shared helper method that uses a language-independent approach.
| /// 获取单年成绩的显示颜色和背景 | |
| Map<String, dynamic> _getScoreDisplayInfo() { | |
| bool isQualified = !toUse.rank.contains("不"); | |
| /// 判断成绩是否合格(语言无关的辅助方法) | |
| bool _isQualifiedRank(String rank) { | |
| final normalized = rank.toLowerCase(); | |
| // Keywords indicating an unqualified / failed result in various locales. | |
| const unqualifiedKeywords = <String>[ | |
| '不', // Simplified/Traditional Chinese "not" as in "不合格" | |
| 'fail', | |
| 'failed', | |
| 'unqualified', | |
| ]; | |
| for (final keyword in unqualifiedKeywords) { | |
| if (normalized.contains(keyword)) { | |
| return false; | |
| } | |
| } | |
| return true; | |
| } | |
| /// 获取单年成绩的显示颜色和背景 | |
| Map<String, dynamic> _getScoreDisplayInfo() { | |
| bool isQualified = _isQualifiedRank(toUse.rank); |
|
卡片最上面,成绩总体信息请重新设计一下。当前设计不太紧凑。 |
|
可以了,我等写完一个功能后合并。 |

sportScore.value.list.length < 4)时不显示“不合格”而是显示“未知”README.md错误对齐的问题(commit c37009c)