轮空、待分配增加 字体颜色区分
This commit is contained in:
@@ -436,7 +436,12 @@ class _ScheduleDetails extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
if (opponentLine.isNotEmpty) ...[
|
if (opponentLine.isNotEmpty) ...[
|
||||||
SizedBox(height: 3.h),
|
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 {
|
class _MetaText extends StatelessWidget {
|
||||||
const _MetaText(this.text);
|
const _MetaText(this.text, {this.color = const Color(0xFF6E747D)});
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
|
|
||||||
|
final Color color;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Text(
|
return Text(
|
||||||
@@ -457,7 +464,7 @@ class _MetaText extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 10.sp,
|
fontSize: 10.sp,
|
||||||
height: 1.2,
|
height: 1.2,
|
||||||
color: const Color(0xFF6E747D),
|
color: color,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -535,12 +542,18 @@ String _formatMemberLine(EventRegistrationItem item) {
|
|||||||
String _formatOpponentLine(EventRegistrationItem item) {
|
String _formatOpponentLine(EventRegistrationItem item) {
|
||||||
final opponent = item.opponentName.trim();
|
final opponent = item.opponentName.trim();
|
||||||
if (opponent.isEmpty && item.allowByeMatch == 0) {
|
if (opponent.isEmpty && item.allowByeMatch == 0) {
|
||||||
return item.completed ? '对手:轮空' : '';
|
return item.completed ? '轮空' : '';
|
||||||
}
|
}
|
||||||
if (opponent.isEmpty && item.allowByeMatch == 1) {
|
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) {
|
String _formatNumberBadge(EventRegistrationItem item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user