diff --git a/lib/modules/scoring/widgets/scoring_dialogs.dart b/lib/modules/scoring/widgets/scoring_dialogs.dart index c546f9d..302b83f 100644 --- a/lib/modules/scoring/widgets/scoring_dialogs.dart +++ b/lib/modules/scoring/widgets/scoring_dialogs.dart @@ -313,6 +313,13 @@ class _SubmissionDetailCard extends StatelessWidget { final SubmissionScoreDetail detail; + String get description { + final labelPrefix = '${detail.label}:'; + return detail.description.startsWith(labelPrefix) + ? detail.description.substring(labelPrefix.length) + : detail.description; + } + @override Widget build(BuildContext context) => Container( padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 10), @@ -330,16 +337,33 @@ class _SubmissionDetailCard extends StatelessWidget { ), child: Align( alignment: Alignment.centerLeft, - child: Text( - detail.description, - maxLines: 3, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - color: AppColors.textPrimary, - fontSize: 14, - height: 1.3, - fontWeight: FontWeight.w700, - ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + detail.label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: AppColors.textPrimary, + fontSize: 14, + height: 1.3, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: 6), + Text( + description, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: AppColors.textSecondary, + fontSize: 12, + height: 1.3, + ), + ), + ], ), ), ); diff --git a/test/submission_dialog_test.dart b/test/submission_dialog_test.dart index 38e0340..3721ec7 100644 --- a/test/submission_dialog_test.dart +++ b/test/submission_dialog_test.dart @@ -7,7 +7,7 @@ import 'package:yd_pattern_scoring_system/modules/scoring/widgets/scoring_dialog void main() { tearDown(Get.reset); - testWidgets('提交确认弹窗仅展示评分类别和录入说明,不展示裁判得分', (tester) async { + testWidgets('提交确认弹窗分行展示评分类别和录入说明,不展示裁判得分', (tester) async { await tester.pumpWidget( GetMaterialApp( home: Scaffold( @@ -35,8 +35,12 @@ void main() { expect(find.text('确认提交成绩'), findsOneWidget); expect(find.text('评分内容(2项)'), findsOneWidget); - expect(find.text('音乐:加2次、减1次'), findsOneWidget); - expect(find.text('完成质量:12.5分'), findsOneWidget); + expect(find.text('音乐'), findsOneWidget); + expect(find.text('加2次、减1次'), findsOneWidget); + expect(find.text('完成质量'), findsOneWidget); + expect(find.text('12.5分'), findsOneWidget); + expect(find.text('音乐:加2次、减1次'), findsNothing); + expect(find.text('完成质量:12.5分'), findsNothing); expect(find.textContaining('裁判总分'), findsNothing); expect(find.textContaining('本次裁判得分'), findsNothing); });