|
@@ -33,7 +33,9 @@ class Competition extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
Align(
|
|
Align(
|
|
|
alignment: Alignment.topLeft,
|
|
alignment: Alignment.topLeft,
|
|
|
- child: Image.asset('images/home_icon_vip.png'),
|
|
|
|
|
|
|
+ child: competitionInfo.type == 2
|
|
|
|
|
+ ? Image.asset('images/home_icon_vip.png')
|
|
|
|
|
+ : Container(),
|
|
|
),
|
|
),
|
|
|
Positioned(
|
|
Positioned(
|
|
|
right: 10,
|
|
right: 10,
|
|
@@ -46,12 +48,15 @@ class Competition extends StatelessWidget {
|
|
|
child: Builder(
|
|
child: Builder(
|
|
|
builder: (context) {
|
|
builder: (context) {
|
|
|
var src = 'images/icon_paimingno.png';
|
|
var src = 'images/icon_paimingno.png';
|
|
|
- if (competitionInfo.participatingInfo != null && competitionInfo.participatingInfo.rank > 0) {
|
|
|
|
|
|
|
+ if (competitionInfo.participatingInfo != null &&
|
|
|
|
|
+ competitionInfo.participatingInfo.rank > 0) {
|
|
|
if (competitionInfo.participatingInfo.rank == 1) {
|
|
if (competitionInfo.participatingInfo.rank == 1) {
|
|
|
src = 'images/icon_paiming01.png';
|
|
src = 'images/icon_paiming01.png';
|
|
|
- } else if (competitionInfo.participatingInfo.rank == 2) {
|
|
|
|
|
|
|
+ } else if (competitionInfo.participatingInfo.rank ==
|
|
|
|
|
+ 2) {
|
|
|
src = 'images/icon_paiming02.png';
|
|
src = 'images/icon_paiming02.png';
|
|
|
- } else if (competitionInfo.participatingInfo.rank == 3) {
|
|
|
|
|
|
|
+ } else if (competitionInfo.participatingInfo.rank ==
|
|
|
|
|
+ 3) {
|
|
|
src = 'images/icon_paiming03.png';
|
|
src = 'images/icon_paiming03.png';
|
|
|
} else {
|
|
} else {
|
|
|
return Stack(
|
|
return Stack(
|
|
@@ -62,7 +67,8 @@ class Competition extends StatelessWidget {
|
|
|
child: Container(
|
|
child: Container(
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
- competitionInfo.participatingInfo.rank.toString(),
|
|
|
|
|
|
|
+ competitionInfo.participatingInfo.rank
|
|
|
|
|
+ .toString(),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
fontSize: 16,
|
|
fontSize: 16,
|
|
|
fontWeight: FontWeight.bold,
|
|
fontWeight: FontWeight.bold,
|
|
@@ -80,7 +86,11 @@ class Competition extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
|
|
|
|
|
|
|
+ Navigator.push(
|
|
|
|
|
+ context,
|
|
|
|
|
+ CupertinoPageRoute(
|
|
|
|
|
+ builder: (context) => CompetitionRank(
|
|
|
|
|
+ competitionId: competitionInfo.id)));
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
@@ -100,7 +110,10 @@ class Competition extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
|
|
|
|
|
|
|
+ Navigator.push(
|
|
|
|
|
+ context,
|
|
|
|
|
+ CupertinoPageRoute(
|
|
|
|
|
+ builder: (context) => CompetitionRooms(competitionInfo)));
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -108,6 +121,7 @@ class Competition extends StatelessWidget {
|
|
|
|
|
|
|
|
class CompetitionOld extends StatelessWidget {
|
|
class CompetitionOld extends StatelessWidget {
|
|
|
final CompetitionInfo competitionInfo;
|
|
final CompetitionInfo competitionInfo;
|
|
|
|
|
+
|
|
|
CompetitionOld(this.competitionInfo);
|
|
CompetitionOld(this.competitionInfo);
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
@@ -144,9 +158,18 @@ class CompetitionOld extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
child: GradientText(
|
|
child: GradientText(
|
|
|
- '¥' + competitionInfo.bonus.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
|
|
|
|
|
|
|
+ '¥' +
|
|
|
|
|
+ competitionInfo.bonus
|
|
|
|
|
+ .toString()
|
|
|
|
|
+ .replaceAllMapped(
|
|
|
|
|
+ RegExp(
|
|
|
|
|
+ r'(\d{1,3})(?=(\d{3})+(?!\d))'),
|
|
|
|
|
+ (Match m) => '${m[1]},'),
|
|
|
gradient: LinearGradient(
|
|
gradient: LinearGradient(
|
|
|
- colors: [Color(0xFFFFC84B), Color(0xFFA26A23)],
|
|
|
|
|
|
|
+ colors: [
|
|
|
|
|
+ Color(0xFFFFC84B),
|
|
|
|
|
+ Color(0xFFA26A23)
|
|
|
|
|
+ ],
|
|
|
begin: Alignment.topCenter,
|
|
begin: Alignment.topCenter,
|
|
|
end: Alignment.bottomCenter,
|
|
end: Alignment.bottomCenter,
|
|
|
),
|
|
),
|
|
@@ -155,9 +178,13 @@ class CompetitionOld extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
'比赛时间' +
|
|
'比赛时间' +
|
|
|
- DateFormat('yyyy.MM.dd').format(DateTime.fromMicrosecondsSinceEpoch(competitionInfo.startTime * 1000)) +
|
|
|
|
|
|
|
+ DateFormat('yyyy.MM.dd').format(
|
|
|
|
|
+ DateTime.fromMicrosecondsSinceEpoch(
|
|
|
|
|
+ competitionInfo.startTime * 1000)) +
|
|
|
'-' +
|
|
'-' +
|
|
|
- DateFormat('yyyy.MM.dd').format(DateTime.fromMicrosecondsSinceEpoch(competitionInfo.endTime * 1000)),
|
|
|
|
|
|
|
+ DateFormat('yyyy.MM.dd').format(
|
|
|
|
|
+ DateTime.fromMicrosecondsSinceEpoch(
|
|
|
|
|
+ competitionInfo.endTime * 1000)),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
color: Color(0xFF9A9CA2),
|
|
color: Color(0xFF9A9CA2),
|
|
|
fontSize: 11,
|
|
fontSize: 11,
|
|
@@ -201,7 +228,8 @@ class CompetitionOld extends StatelessWidget {
|
|
|
child: Builder(
|
|
child: Builder(
|
|
|
builder: (context) {
|
|
builder: (context) {
|
|
|
var src = 'images/icon_paimingno.png';
|
|
var src = 'images/icon_paimingno.png';
|
|
|
- if (competitionInfo.participatingInfo != null && competitionInfo.participatingInfo.rank > 0) {
|
|
|
|
|
|
|
+ if (competitionInfo.participatingInfo != null &&
|
|
|
|
|
+ competitionInfo.participatingInfo.rank > 0) {
|
|
|
if (competitionInfo.participatingInfo.rank == 1) {
|
|
if (competitionInfo.participatingInfo.rank == 1) {
|
|
|
src = 'images/icon_paiming01.png';
|
|
src = 'images/icon_paiming01.png';
|
|
|
} else if (competitionInfo.participatingInfo.rank == 2) {
|
|
} else if (competitionInfo.participatingInfo.rank == 2) {
|
|
@@ -217,7 +245,8 @@ class CompetitionOld extends StatelessWidget {
|
|
|
child: Container(
|
|
child: Container(
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
child: Text(
|
|
child: Text(
|
|
|
- competitionInfo.participatingInfo.rank.toString(),
|
|
|
|
|
|
|
+ competitionInfo.participatingInfo.rank
|
|
|
|
|
+ .toString(),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
fontSize: 16,
|
|
fontSize: 16,
|
|
|
fontWeight: FontWeight.bold,
|
|
fontWeight: FontWeight.bold,
|
|
@@ -250,7 +279,10 @@ class CompetitionOld extends StatelessWidget {
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
|
|
|
|
|
|
|
+ Navigator.push(
|
|
|
|
|
+ context,
|
|
|
|
|
+ CupertinoPageRoute(
|
|
|
|
|
+ builder: (context) => CompetitionRooms(competitionInfo)));
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|