diff --git a/lib/features/events/pages/page_event_info.dart b/lib/features/events/pages/page_event_info.dart index d7e7371..485f9c0 100644 --- a/lib/features/events/pages/page_event_info.dart +++ b/lib/features/events/pages/page_event_info.dart @@ -436,7 +436,12 @@ class _ScheduleDetails extends StatelessWidget { ], if (opponentLine.isNotEmpty) ...[ SizedBox(height: 3.h), - _MetaText(opponentLine), + Row( + children: [ + _MetaText('对手:'), + _MetaText(opponentLine, color: _opponentLineColor(opponentLine)), + ], + ), ], ], ); @@ -444,10 +449,12 @@ class _ScheduleDetails extends StatelessWidget { } class _MetaText extends StatelessWidget { - const _MetaText(this.text); + const _MetaText(this.text, {this.color = const Color(0xFF6E747D)}); final String text; + final Color color; + @override Widget build(BuildContext context) { return Text( @@ -457,7 +464,7 @@ class _MetaText extends StatelessWidget { style: TextStyle( fontSize: 10.sp, height: 1.2, - color: const Color(0xFF6E747D), + color: color, fontWeight: FontWeight.w400, ), ); @@ -535,12 +542,18 @@ String _formatMemberLine(EventRegistrationItem item) { String _formatOpponentLine(EventRegistrationItem item) { final opponent = item.opponentName.trim(); if (opponent.isEmpty && item.allowByeMatch == 0) { - return item.completed ? '对手:轮空' : ''; + return item.completed ? '轮空' : ''; } if (opponent.isEmpty && item.allowByeMatch == 1) { - return '对手:待分配'; + return '待分配'; } - return '对手:$opponent'; + return opponent; +} + +Color _opponentLineColor(String opponentLine) { + if (opponentLine.contains('待分配')) return const Color(0xFFF1C585); + if (opponentLine.contains('轮空')) return const Color(0xFF41BFBF); + return const Color(0xFF6E747D); } String _formatNumberBadge(EventRegistrationItem item) {