所有项目打分预览页面和个人花样打分预览页面描述形式保持一致

This commit is contained in:
马梓彭 2026-10-13 15:47:48 +08:00
parent 37d156efa0
commit 37e919df25
2 changed files with 41 additions and 13 deletions

View File

@ -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,
),
),
],
),
),
);

View File

@ -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);
});