|
|
@@ -18,126 +18,127 @@ class Competition extends StatelessWidget {
|
|
|
Widget build(BuildContext context) {
|
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
|
+ decoration: BoxDecoration(borderRadius: BorderRadius.circular(4)),
|
|
|
margin: EdgeInsets.only(left: 15, right: 15, bottom: 15),
|
|
|
child: AspectRatio(
|
|
|
aspectRatio: 345 / 186,
|
|
|
- child: Stack(
|
|
|
- children: <Widget>[
|
|
|
- AspectRatio(
|
|
|
- aspectRatio: 345 / 186,
|
|
|
- child: CachedNetworkImage(
|
|
|
- imageUrl: competitionInfo.pic,
|
|
|
- fit: BoxFit.cover,
|
|
|
+ child: ClipRRect(
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
+ child: Stack(
|
|
|
+ children: <Widget>[
|
|
|
+ AspectRatio(
|
|
|
+ aspectRatio: 345 / 186,
|
|
|
+ child: CachedNetworkImage(
|
|
|
+ imageUrl: competitionInfo.pic,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- AspectRatio(
|
|
|
- aspectRatio: 345 / 136,
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [Color(0xff000000).withAlpha(128), Color(0xff000000).withAlpha(0)],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- )),
|
|
|
+ AspectRatio(
|
|
|
+ aspectRatio: 345 / 136,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [Color(0xff000000).withAlpha(128), Color(0xff000000).withAlpha(0)],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ )),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.topLeft,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(top: 13, left: 15),
|
|
|
- child: Row(
|
|
|
- children: <Widget>[
|
|
|
- Text(
|
|
|
- competitionInfo.competitionName,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 18,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.topLeft,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(top: 13, left: 15),
|
|
|
+ child: Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Text(
|
|
|
+ competitionInfo.competitionName,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 18,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 20,
|
|
|
- margin: EdgeInsets.only(left: 6),
|
|
|
- decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.white),
|
|
|
- padding: EdgeInsets.only(left: 4, right: 4),
|
|
|
- child: GestureDetector(
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- competitionInfo.participatingInfo?.rank != null ? ('第' + competitionInfo.participatingInfo.rank.toString() + '名') : '未上榜',
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xff19213B),
|
|
|
- fontSize: 12,
|
|
|
+ Container(
|
|
|
+ height: 20,
|
|
|
+ margin: EdgeInsets.only(left: 6),
|
|
|
+ decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.white),
|
|
|
+ padding: EdgeInsets.only(left: 4, right: 4),
|
|
|
+ child: GestureDetector(
|
|
|
+ child: Center(
|
|
|
+ child: Text(
|
|
|
+ competitionInfo.participatingInfo?.rank != null ? ('第' + competitionInfo.participatingInfo.rank.toString() + '名') : '未上榜',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Color(0xff19213B),
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
+ onTap: () {
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
|
|
|
+ },
|
|
|
),
|
|
|
- onTap: () {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
|
|
|
- },
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.topLeft,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(top: 44, left: 15),
|
|
|
- child: Text(
|
|
|
- readTimestamp(competitionInfo.startTime, 'yyyy.MM.dd') + '-' + readTimestamp(competitionInfo.endTime, 'yyyy.MM.dd'),
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 12,
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.topLeft,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(top: 44, left: 15),
|
|
|
+ child: Text(
|
|
|
+ readTimestamp(competitionInfo.startTime, 'yyyy.MM.dd') + '-' + readTimestamp(competitionInfo.endTime, 'yyyy.MM.dd'),
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.topLeft,
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.white)),
|
|
|
- padding: EdgeInsets.only(left: 2, right: 2),
|
|
|
- margin: EdgeInsets.only(top: 82, left: 15),
|
|
|
- child: Text(
|
|
|
- '赛事奖励',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 12,
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.topLeft,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.white)),
|
|
|
+ padding: EdgeInsets.only(left: 2, right: 2),
|
|
|
+ margin: EdgeInsets.only(top: 82, left: 15),
|
|
|
+ child: Text(
|
|
|
+ '赛事奖励',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 12,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.bottomLeft,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 15, bottom: 12),
|
|
|
- child: Row(
|
|
|
- children: competitionInfo.awardPic.split(',').map<Widget>((f) {
|
|
|
- return Container(
|
|
|
- width: 60,
|
|
|
- height: 60,
|
|
|
- margin: EdgeInsets.only(right: 5),
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.circular(2),
|
|
|
- color: Colors.white,
|
|
|
- ),
|
|
|
- child: CachedNetworkImage(
|
|
|
- imageUrl: f,
|
|
|
- fit: BoxFit.contain,
|
|
|
- ),
|
|
|
- );
|
|
|
- }).toList(),
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.bottomLeft,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(left: 15, bottom: 12),
|
|
|
+ child: Row(
|
|
|
+ children: competitionInfo.awardPic.split(',').map<Widget>((f) {
|
|
|
+ return Container(
|
|
|
+ width: 60,
|
|
|
+ height: 60,
|
|
|
+ margin: EdgeInsets.only(right: 5),
|
|
|
+ decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.transparent),
|
|
|
+ child: CachedNetworkImage(
|
|
|
+ imageUrl: f,
|
|
|
+ fit: BoxFit.contain,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }).toList(),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- Align(
|
|
|
- alignment: Alignment.bottomRight,
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(bottom: 12),
|
|
|
- child: Image.asset(competitionInfo.type == 2 ? 'images/icon_kaishi_vip.png' : 'images/icon_kaishi_putong.png'),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
+ Align(
|
|
|
+ alignment: Alignment.bottomRight,
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(bottom: 12),
|
|
|
+ child: Image.asset(competitionInfo.type == 2 ? 'images/icon_kaishi_vip.png' : 'images/icon_kaishi_putong.png'),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|