From c37009cbcb8755a2459c9302a600cd3535157ced Mon Sep 17 00:00:00 2001 From: imoscarz Date: Sun, 18 Jan 2026 17:05:50 +0800 Subject: [PATCH 1/5] docs: fix align problem in README.md --- .vscode/settings.json | 2 +- README.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 59e93a9c..c029eee2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "mesonbuild.configureOnOpen": false, "dart.flutterSdkPaths": [ - ".fvm/flutter_sdk", + ".fvm/flutter_sdk" ], "dart.analysisExcludedFolders": [ ".flutter" diff --git a/README.md b/README.md index b3f83074..5d1ddf18 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,12 @@ XDYou,代码名称为 Traintime PDA,是为西电学生设计的开源信息 [Get it on App Store](https://apps.apple.com/us/app/xdyou/id6461723688?l=zh-Hans-CN) + height="60px">](https://apps.apple.com/us/app/xdyou/id6461723688?l=zh-Hans-CN) [Get it on F-Droid](https://f-droid.org/zh_Hans/packages/io.github.benderblog.traintime_pda/) + height="60px">](https://f-droid.org/zh_Hans/packages/io.github.benderblog.traintime_pda/) + + ## 特性概览 From ad6b896988b2f84b99f479f58a1bb399c027c64e Mon Sep 17 00:00:00 2001 From: imoscarz Date: Sun, 18 Jan 2026 17:06:30 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9B=9B?= =?UTF-8?q?=E5=B9=B4=E6=88=90=E7=BB=A9=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E6=A0=87=E7=AD=BE=EF=BC=8C=E4=BC=98=E5=8C=96=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=8D=A1=E7=89=87=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- assets/flutter_i18n/en_US.yaml | 2 + assets/flutter_i18n/zh_CN.yaml | 2 + assets/flutter_i18n/zh_TW.yaml | 2 + lib/page/sport/sport_score_window.dart | 274 +++++++++++++++++++++---- 5 files changed, 245 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 6647cc79..3a4a1dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -52,5 +52,5 @@ app.*.map.json /android/app/release # fvm flutter sdk -.fvm/flutter_sdk +.fvm/ *.APK diff --git a/assets/flutter_i18n/en_US.yaml b/assets/flutter_i18n/en_US.yaml index 47fb22ab..7e3346a0 100644 --- a/assets/flutter_i18n/en_US.yaml +++ b/assets/flutter_i18n/en_US.yaml @@ -867,6 +867,8 @@ sport: test_score: "Sport test score" # TODO: change sport score to support i18n total_score: "Four-year total score" + total_score_label: "Total Score" + rank_label: "Rank" semester: "Semester {year} {gradeType}" subject: "Subject" data: "Data" diff --git a/assets/flutter_i18n/zh_CN.yaml b/assets/flutter_i18n/zh_CN.yaml index 052ba615..3b368c7f 100644 --- a/assets/flutter_i18n/zh_CN.yaml +++ b/assets/flutter_i18n/zh_CN.yaml @@ -854,6 +854,8 @@ sport: test_score: "体测成绩" # TODO: change sport score to support i18n total_score: "四年总分" + total_score_label: "总分" + rank_label: "等级" semester: "{year} 第{gradeType}" subject: "项目" data: "数据" diff --git a/assets/flutter_i18n/zh_TW.yaml b/assets/flutter_i18n/zh_TW.yaml index a14776bc..456550ed 100644 --- a/assets/flutter_i18n/zh_TW.yaml +++ b/assets/flutter_i18n/zh_TW.yaml @@ -826,6 +826,8 @@ sport: empty_class_info: 未查詢到課程信息 test_score: 體測成績 total_score: 四年總分 + total_score_label: 總分 + rank_label: 等級 semester: '{year} 第{gradeType}' subject: 項目 data: 數據 diff --git a/lib/page/sport/sport_score_window.dart b/lib/page/sport/sport_score_window.dart index fd9d2454..10d911ad 100644 --- a/lib/page/sport/sport_score_window.dart +++ b/lib/page/sport/sport_score_window.dart @@ -34,6 +34,47 @@ class _SportScoreWindowState extends State } } + /// 判断四年成绩是否完整 + bool _isFourYearsComplete() { + // 标准的四年应该有4年的成绩记录 + return sportScore.value.list.length >= 4; + } + + /// 获取总分显示值和颜色 + Map _getTotalScoreInfo() { + final score = sportScore.value.total; + + if (!_isFourYearsComplete()) { + return { + 'score': score, + 'rank': FlutterI18n.translate( + context, + "class_attendance.course_state.unknown", + ), + 'scoreBackgroundColor': Colors.grey.withValues(alpha: 0.15), + 'scoreTextColor': Colors.grey[900], + 'rankBackgroundColor': Colors.grey.withValues(alpha: 0.1), + 'rankTextColor': Colors.grey[800], + 'isBold': false, + }; + } + + bool isQualified = !sportScore.value.rank.contains("不"); + return { + 'score': score, + 'rank': sportScore.value.rank, + 'scoreBackgroundColor': isQualified + ? Colors.green.withValues(alpha: 0.15) + : Colors.red.withValues(alpha: 0.15), + 'scoreTextColor': isQualified ? Colors.green[900] : Colors.red[900], + 'rankBackgroundColor': isQualified + ? Colors.green.withValues(alpha: 0.1) + : Colors.red.withValues(alpha: 0.1), + 'rankTextColor': isQualified ? Colors.green[800] : Colors.red[800], + 'isBold': true, + }; + } + @override Widget build(BuildContext context) { super.build(context); @@ -44,30 +85,104 @@ class _SportScoreWindowState extends State child: Obx(() { if (sportScore.value.situation == null && sportScore.value.detail.isNotEmpty) { + final scoreInfo = _getTotalScoreInfo(); List things = [ ReXCard( title: Text(FlutterI18n.translate(context, "sport.total_score")), - remaining: [ - ReXCardRemaining( - sportScore.value.total, - color: sportScore.value.rank.contains("不") - ? Colors.red - : null, - isBold: true, - ), - ReXCardRemaining( - sportScore.value.rank, - color: sportScore.value.rank.contains("不") - ? Colors.red - : null, - isBold: sportScore.value.rank.contains("不"), - ), - ], - bottomRow: Text( - sportScore.value.detail.substring( - 0, - sportScore.value.detail.indexOf("\\"), - ), + remaining: [], + bottomRow: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + FlutterI18n.translate( + context, + "sport.total_score_label", + ), + style: const TextStyle(fontSize: 13), + ), + const SizedBox(height: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + decoration: BoxDecoration( + color: scoreInfo['scoreBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + scoreInfo['score'], + style: TextStyle( + color: scoreInfo['scoreTextColor'], + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + ), + ], + ), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + FlutterI18n.translate( + context, + "sport.rank_label", + ), + style: const TextStyle(fontSize: 13), + ), + const SizedBox(height: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: scoreInfo['rankBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + scoreInfo['rank'], + style: TextStyle( + color: scoreInfo['rankTextColor'], + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + ), + ], + ), + ), + ], + ), + ), + const Divider(height: 16, thickness: 0.5), + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: Center( + child: Text( + sportScore.value.detail.substring( + 0, + sportScore.value.detail.indexOf("\\"), + ), + style: Theme.of(context).textTheme.bodySmall, + textAlign: TextAlign.center, + ), + ), + ), + ], ), ), ]; @@ -112,8 +227,26 @@ class ScoreCard extends StatelessWidget { String unitToShow(String eval) => eval.contains(".") ? eval.substring(0, eval.indexOf(".")) : eval; + /// 获取单年成绩的显示颜色和背景 + Map _getScoreDisplayInfo() { + bool isQualified = !toUse.rank.contains("不"); + return { + 'scoreBackgroundColor': isQualified + ? Colors.green.withValues(alpha: 0.15) + : Colors.red.withValues(alpha: 0.15), + 'scoreTextColor': isQualified ? Colors.green[900] : Colors.red[900], + 'rankBackgroundColor': isQualified + ? Colors.green.withValues(alpha: 0.1) + : Colors.red.withValues(alpha: 0.1), + 'rankTextColor': isQualified ? Colors.green[800] : Colors.red[800], + 'isBold': true, + }; + } + @override Widget build(BuildContext context) { + final displayInfo = _getScoreDisplayInfo(); + return ReXCard( title: Text( FlutterI18n.translate( @@ -122,20 +255,86 @@ class ScoreCard extends StatelessWidget { translationParams: {"year": toUse.year, "gradeType": toUse.gradeType}, ), ), - remaining: [ - ReXCardRemaining( - toUse.totalScore, - color: toUse.rank.contains("不") ? Colors.red : null, - isBold: true, - ), - ReXCardRemaining( - toUse.rank, - color: toUse.rank.contains("不") ? Colors.red : null, - isBold: toUse.rank.contains("不"), - ), - ], - bottomRow: toUse.details.isNotEmpty - ? Table( + remaining: [], + bottomRow: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + FlutterI18n.translate( + context, + "sport.total_score_label", + ), + style: const TextStyle(fontSize: 13), + ), + const SizedBox(height: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, + ), + decoration: BoxDecoration( + color: displayInfo['scoreBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + toUse.totalScore, + style: TextStyle( + color: displayInfo['scoreTextColor'], + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + ), + ], + ), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + FlutterI18n.translate(context, "sport.rank_label"), + style: const TextStyle(fontSize: 13), + ), + const SizedBox(height: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 8, + ), + decoration: BoxDecoration( + color: displayInfo['rankBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + toUse.rank, + style: TextStyle( + color: displayInfo['rankTextColor'], + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + ), + ], + ), + ), + ], + ), + ), + if (toUse.details.isNotEmpty) + const Divider(height: 16, thickness: 0.5), + if (toUse.details.isNotEmpty) + Table( columnWidths: const { 0: FlexColumnWidth(1.2), 1: FlexColumnWidth(1.4), @@ -212,7 +411,10 @@ class ScoreCard extends StatelessWidget { ), ], ) - : Text(toUse.moreinfo), + else + Text(toUse.moreinfo), + ], + ), ); } } From 964ddef8efca80452b544aff860d762769afeb4c Mon Sep 17 00:00:00 2001 From: imoscarz Date: Sun, 18 Jan 2026 20:40:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=9C=E8=89=B2=E6=96=B9=E6=A1=88=E5=92=8C=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/page/sport/sport_score_window.dart | 387 +++++++++++++------------ 1 file changed, 203 insertions(+), 184 deletions(-) diff --git a/lib/page/sport/sport_score_window.dart b/lib/page/sport/sport_score_window.dart index 10d911ad..0265c1ac 100644 --- a/lib/page/sport/sport_score_window.dart +++ b/lib/page/sport/sport_score_window.dart @@ -14,6 +14,15 @@ import 'package:watermeter/model/xidian_sport/score.dart'; import 'package:watermeter/page/public_widget/re_x_card.dart'; import 'package:watermeter/repository/xidian_sport_session.dart'; +// 常量定义 +const double _textBackgroundAlpha = 0.3; +// const double _textTitleBackgroundAlpha = 0.6; +const int _primaryColorShade = 900; +const int _secondaryColorShade = 900; +const double _scoreFontSize = 13.0; +const double _rankFontSize = 13.0; +const double _labelFontSize = 11.0; + class SportScoreWindow extends StatefulWidget { const SportScoreWindow({super.key}); @@ -26,6 +35,32 @@ class _SportScoreWindowState extends State @override bool get wantKeepAlive => true; + /// 根据合格/不合格状态获取颜色方案 + Map _getColorScheme(bool isQualified, bool isUnknown) { + if (isUnknown) { + return { + 'scoreBackgroundColor': Colors.grey.withValues( + alpha: _textBackgroundAlpha, + ), + 'scoreTextColor': Colors.grey[_primaryColorShade], + 'rankBackgroundColor': Colors.grey.withValues( + alpha: _textBackgroundAlpha, + ), + 'rankTextColor': Colors.grey[_secondaryColorShade], + }; + } + + final baseColor = isQualified ? Colors.green : Colors.red; + return { + 'scoreBackgroundColor': baseColor.withValues( + alpha: _textBackgroundAlpha, + ), + 'scoreTextColor': baseColor[_primaryColorShade], + 'rankBackgroundColor': baseColor.withValues(alpha: _textBackgroundAlpha), + 'rankTextColor': baseColor[_secondaryColorShade], + }; + } + @override void initState() { super.initState(); @@ -43,38 +78,93 @@ class _SportScoreWindowState extends State /// 获取总分显示值和颜色 Map _getTotalScoreInfo() { final score = sportScore.value.total; + final isUnknown = !_isFourYearsComplete(); + final isQualified = !sportScore.value.rank.contains("不"); - if (!_isFourYearsComplete()) { - return { - 'score': score, - 'rank': FlutterI18n.translate( - context, - "class_attendance.course_state.unknown", - ), - 'scoreBackgroundColor': Colors.grey.withValues(alpha: 0.15), - 'scoreTextColor': Colors.grey[900], - 'rankBackgroundColor': Colors.grey.withValues(alpha: 0.1), - 'rankTextColor': Colors.grey[800], - 'isBold': false, - }; - } + final colorScheme = _getColorScheme(isQualified, isUnknown); - bool isQualified = !sportScore.value.rank.contains("不"); return { 'score': score, - 'rank': sportScore.value.rank, - 'scoreBackgroundColor': isQualified - ? Colors.green.withValues(alpha: 0.15) - : Colors.red.withValues(alpha: 0.15), - 'scoreTextColor': isQualified ? Colors.green[900] : Colors.red[900], - 'rankBackgroundColor': isQualified - ? Colors.green.withValues(alpha: 0.1) - : Colors.red.withValues(alpha: 0.1), - 'rankTextColor': isQualified ? Colors.green[800] : Colors.red[800], - 'isBold': true, + 'rank': isUnknown + ? FlutterI18n.translate( + context, + "class_attendance.course_state.unknown", + ) + : sportScore.value.rank, + ...colorScheme, }; } + /// 显示分数与等级的行布局 + Widget _buildScoreRankRow(Map displayInfo) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + FlutterI18n.translate(context, "sport.total_score_label"), + style: const TextStyle(fontSize: _labelFontSize), + ), + const SizedBox(width: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + decoration: BoxDecoration( + color: displayInfo['scoreBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + displayInfo['score'], + style: TextStyle( + color: displayInfo['scoreTextColor'], + fontWeight: FontWeight.bold, + fontSize: _scoreFontSize, + ), + ), + ), + ], + ), + ), + const SizedBox(width: 12), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + FlutterI18n.translate(context, "sport.rank_label"), + style: const TextStyle(fontSize: _labelFontSize), + ), + const SizedBox(width: 6), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + decoration: BoxDecoration( + color: displayInfo['rankBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + displayInfo['rank'], + style: TextStyle( + color: displayInfo['rankTextColor'], + fontWeight: FontWeight.bold, + fontSize: _rankFontSize, + ), + ), + ), + ], + ), + ), + ], + ); + } + @override Widget build(BuildContext context) { super.build(context); @@ -95,78 +185,7 @@ class _SportScoreWindowState extends State children: [ Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - FlutterI18n.translate( - context, - "sport.total_score_label", - ), - style: const TextStyle(fontSize: 13), - ), - const SizedBox(height: 6), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - decoration: BoxDecoration( - color: scoreInfo['scoreBackgroundColor'], - borderRadius: BorderRadius.circular(6), - ), - child: Text( - scoreInfo['score'], - style: TextStyle( - color: scoreInfo['scoreTextColor'], - fontWeight: FontWeight.bold, - fontSize: 15, - ), - ), - ), - ], - ), - ), - const SizedBox(width: 16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - FlutterI18n.translate( - context, - "sport.rank_label", - ), - style: const TextStyle(fontSize: 13), - ), - const SizedBox(height: 6), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, - ), - decoration: BoxDecoration( - color: scoreInfo['rankBackgroundColor'], - borderRadius: BorderRadius.circular(6), - ), - child: Text( - scoreInfo['rank'], - style: TextStyle( - color: scoreInfo['rankTextColor'], - fontWeight: FontWeight.bold, - fontSize: 15, - ), - ), - ), - ], - ), - ), - ], - ), + child: _buildScoreRankRow(scoreInfo), ), const Divider(height: 16, thickness: 0.5), Padding( @@ -227,112 +246,112 @@ class ScoreCard extends StatelessWidget { String unitToShow(String eval) => eval.contains(".") ? eval.substring(0, eval.indexOf(".")) : eval; - /// 获取单年成绩的显示颜色和背景 Map _getScoreDisplayInfo() { - bool isQualified = !toUse.rank.contains("不"); + final isQualified = !toUse.rank.contains("不"); + final baseColor = isQualified ? Colors.green : Colors.red; + return { + 'scoreBackgroundColor': baseColor.withValues( + alpha: _textBackgroundAlpha, + ), + 'scoreTextColor': baseColor[_primaryColorShade], + 'rankBackgroundColor': baseColor.withValues(alpha: _textBackgroundAlpha), + 'rankTextColor': baseColor[_secondaryColorShade], + }; + } + + Map _getTitleBadgeColorScheme() { + final isQualified = !toUse.rank.contains("不"); + final baseColor = isQualified ? Colors.green : Colors.red; return { - 'scoreBackgroundColor': isQualified - ? Colors.green.withValues(alpha: 0.15) - : Colors.red.withValues(alpha: 0.15), - 'scoreTextColor': isQualified ? Colors.green[900] : Colors.red[900], - 'rankBackgroundColor': isQualified - ? Colors.green.withValues(alpha: 0.1) - : Colors.red.withValues(alpha: 0.1), - 'rankTextColor': isQualified ? Colors.green[800] : Colors.red[800], - 'isBold': true, + 'scoreBackgroundColor': baseColor[_primaryColorShade], + 'scoreTextColor': Colors.white, + 'rankBackgroundColor': baseColor[_primaryColorShade], + 'rankTextColor': Colors.white, }; } @override Widget build(BuildContext context) { final displayInfo = _getScoreDisplayInfo(); + final titleBadgeInfo = _getTitleBadgeColorScheme(); return ReXCard( - title: Text( - FlutterI18n.translate( - context, - "sport.semester", - translationParams: {"year": toUse.year, "gradeType": toUse.gradeType}, - ), - ), - remaining: [], - bottomRow: Column( - crossAxisAlignment: CrossAxisAlignment.start, + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.only(bottom: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Expanded( + child: Text( + FlutterI18n.translate( + context, + "sport.semester", + translationParams: { + "year": toUse.year, + "gradeType": toUse.gradeType, + }, + ), + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 8), + Flexible( + child: Wrap( + crossAxisAlignment: WrapCrossAlignment.center, + spacing: 8, + runSpacing: 4, children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - FlutterI18n.translate( - context, - "sport.total_score_label", - ), - style: const TextStyle(fontSize: 13), - ), - const SizedBox(height: 6), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - decoration: BoxDecoration( - color: displayInfo['scoreBackgroundColor'], - borderRadius: BorderRadius.circular(6), - ), - child: Text( - toUse.totalScore, - style: TextStyle( - color: displayInfo['scoreTextColor'], - fontWeight: FontWeight.bold, - fontSize: 15, - ), - ), - ), - ], + Text( + "${FlutterI18n.translate(context, "sport.total_score_label")}:", + style: const TextStyle(fontSize: _labelFontSize), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + decoration: BoxDecoration( + color: titleBadgeInfo['scoreBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + toUse.totalScore, + style: TextStyle( + color: titleBadgeInfo['scoreTextColor'], + fontWeight: FontWeight.bold, + fontSize: _scoreFontSize, + ), ), ), - const SizedBox(width: 16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - FlutterI18n.translate(context, "sport.rank_label"), - style: const TextStyle(fontSize: 13), - ), - const SizedBox(height: 6), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 8, - ), - decoration: BoxDecoration( - color: displayInfo['rankBackgroundColor'], - borderRadius: BorderRadius.circular(6), - ), - child: Text( - toUse.rank, - style: TextStyle( - color: displayInfo['rankTextColor'], - fontWeight: FontWeight.bold, - fontSize: 15, - ), - ), - ), - ], + Text( + "${FlutterI18n.translate(context, "sport.rank_label")}:", + style: const TextStyle(fontSize: _labelFontSize), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + decoration: BoxDecoration( + color: titleBadgeInfo['rankBackgroundColor'], + borderRadius: BorderRadius.circular(6), + ), + child: Text( + toUse.rank, + style: TextStyle( + color: titleBadgeInfo['rankTextColor'], + fontWeight: FontWeight.bold, + fontSize: _rankFontSize, + ), ), ), ], ), ), - if (toUse.details.isNotEmpty) - const Divider(height: 16, thickness: 0.5), + ], + ), + remaining: [], + bottomRow: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ if (toUse.details.isNotEmpty) Table( columnWidths: const { From 3eb7b6393ec053a9b4f742b0227a8c9b3adbf75a Mon Sep 17 00:00:00 2001 From: imoscarz Date: Sun, 18 Jan 2026 20:47:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=8D=A1=E7=89=87=E4=B8=AD=E7=9A=84=E6=8E=92=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/page/sport/sport_score_window.dart | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/page/sport/sport_score_window.dart b/lib/page/sport/sport_score_window.dart index 0265c1ac..193a0484 100644 --- a/lib/page/sport/sport_score_window.dart +++ b/lib/page/sport/sport_score_window.dart @@ -321,28 +321,6 @@ class ScoreCard extends StatelessWidget { ), ), ), - Text( - "${FlutterI18n.translate(context, "sport.rank_label")}:", - style: const TextStyle(fontSize: _labelFontSize), - ), - Container( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 6, - ), - decoration: BoxDecoration( - color: titleBadgeInfo['rankBackgroundColor'], - borderRadius: BorderRadius.circular(6), - ), - child: Text( - toUse.rank, - style: TextStyle( - color: titleBadgeInfo['rankTextColor'], - fontWeight: FontWeight.bold, - fontSize: _rankFontSize, - ), - ), - ), ], ), ), From a368f8edb76f483538d486ac4140e109b68b32f9 Mon Sep 17 00:00:00 2001 From: imoscarz Date: Sun, 18 Jan 2026 20:57:11 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=9C=80=E5=B0=8F=E5=B0=BA=E5=AF=B8=E4=BB=A5=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E8=BF=87=E5=BA=A6=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- windows/runner/win32_window.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp index 60608d0f..8f1b6b24 100644 --- a/windows/runner/win32_window.cpp +++ b/windows/runner/win32_window.cpp @@ -187,6 +187,14 @@ Win32Window::MessageHandler(HWND hwnd, } return 0; + case WM_GETMINMAXINFO: { + MINMAXINFO* min_max_info = reinterpret_cast(lparam); + // Set minimum window size to prevent excessive compression + min_max_info->ptMinTrackSize.x = 800; // Minimum width + min_max_info->ptMinTrackSize.y = 600; // Minimum height + return 0; + } + case WM_DPICHANGED: { auto newRectSize = reinterpret_cast(lparam); LONG newWidth = newRectSize->right - newRectSize->left;