|
|
@@ -11,14 +11,14 @@ import '../model/GameInfo.dart';
|
|
|
import '../pages/RoomInfo.dart';
|
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import '../redux/AppState.dart';
|
|
|
+import '../widget/ScoreType.dart';
|
|
|
|
|
|
class RecordList extends StatefulWidget {
|
|
|
@override
|
|
|
RecordListState createState() => RecordListState();
|
|
|
}
|
|
|
|
|
|
-class RecordListState extends State<RecordList>
|
|
|
- with SingleTickerProviderStateMixin {
|
|
|
+class RecordListState extends State<RecordList> with SingleTickerProviderStateMixin {
|
|
|
final List<Tab> myTabs = <Tab>[Tab(text: '我创建的'), Tab(text: '我加入的')];
|
|
|
TabController _tabController;
|
|
|
@override
|
|
|
@@ -53,9 +53,7 @@ class RecordListState extends State<RecordList>
|
|
|
),
|
|
|
body: Container(
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
- child: TabBarView(
|
|
|
- controller: _tabController,
|
|
|
- children: <Widget>[RecordInfo(0), RecordInfo(1)]),
|
|
|
+ child: TabBarView(controller: _tabController, children: <Widget>[RecordInfo(0), RecordInfo(1)]),
|
|
|
color: Color(0xFF2B2B42),
|
|
|
));
|
|
|
}
|
|
|
@@ -109,11 +107,8 @@ class RecordInfoState extends State<RecordInfo> {
|
|
|
getHousePage();
|
|
|
return;
|
|
|
}
|
|
|
- Result res = await HttpManager.get('playerInfo/page', data: {
|
|
|
- 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
- 'currentPage': currentPage,
|
|
|
- 'pageNumber': 20
|
|
|
- });
|
|
|
+ Result res = await HttpManager.get('playerInfo/page',
|
|
|
+ data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'currentPage': currentPage, 'pageNumber': 20});
|
|
|
Toast.hide();
|
|
|
List<PlayerInfo> list = playerList;
|
|
|
if (currentPage == 1) {
|
|
|
@@ -177,15 +172,11 @@ class RecordInfoState extends State<RecordInfo> {
|
|
|
if (houseList.isEmpty) {
|
|
|
return Text(
|
|
|
'还没有战绩快去比赛吧...',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white30, fontSize: 13, height: 2),
|
|
|
+ style: TextStyle(color: Colors.white30, fontSize: 13, height: 2),
|
|
|
textAlign: TextAlign.center,
|
|
|
);
|
|
|
}
|
|
|
- return houseItem(
|
|
|
- roomInfo: houseList[index],
|
|
|
- gameInfo: houseList[index].gameInfo,
|
|
|
- type:1);
|
|
|
+ return houseItem(roomInfo: houseList[index], gameInfo: houseList[index].gameInfo, type: 1);
|
|
|
})
|
|
|
: ListView.builder(
|
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
|
@@ -195,15 +186,11 @@ class RecordInfoState extends State<RecordInfo> {
|
|
|
if (playerList.isEmpty) {
|
|
|
return Text(
|
|
|
'还没有战绩快去比赛吧...',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white30, fontSize: 13, height: 2),
|
|
|
+ style: TextStyle(color: Colors.white30, fontSize: 13, height: 2),
|
|
|
textAlign: TextAlign.center,
|
|
|
);
|
|
|
}
|
|
|
- return houseItem(
|
|
|
- roomInfo: playerList[index].houseInfo,
|
|
|
- gameInfo: playerList[index].gameInfo,
|
|
|
- playerInfo: playerList[index],type:2);
|
|
|
+ return houseItem(roomInfo: playerList[index].houseInfo, gameInfo: playerList[index].gameInfo, playerInfo: playerList[index], type: 2);
|
|
|
}),
|
|
|
)),
|
|
|
);
|
|
|
@@ -211,8 +198,7 @@ class RecordInfoState extends State<RecordInfo> {
|
|
|
}
|
|
|
|
|
|
class houseItem extends StatelessWidget {
|
|
|
- houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo,this.type=0})
|
|
|
- : super(key: key);
|
|
|
+ houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo, this.type = 0}) : super(key: key);
|
|
|
final HouseInfo roomInfo;
|
|
|
final GameInfo gameInfo;
|
|
|
final PlayerInfo playerInfo;
|
|
|
@@ -220,12 +206,7 @@ class houseItem extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- List imageList = [
|
|
|
- 'images/jiangpai_huangjin.png',
|
|
|
- 'images/jiangpai_baiyin.png',
|
|
|
- 'images/jiangpai_qingtong.png',
|
|
|
- 'images/zhanji_icon_04.png'
|
|
|
- ];
|
|
|
+ List imageList = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/zhanji_icon_04.png'];
|
|
|
String imageSrc = '';
|
|
|
String tishiStr = '';
|
|
|
Color tishiColor;
|
|
|
@@ -242,8 +223,7 @@ class houseItem extends StatelessWidget {
|
|
|
if (playerInfo.statusFlag != null) {
|
|
|
if (playerInfo.statusFlag == 6) {
|
|
|
imageSrc = imageList[3];
|
|
|
- } else if (playerInfo.statusFlag < 4 ||
|
|
|
- (roomInfo.statusFlag >= 2 && roomInfo.statusFlag < 4)) {
|
|
|
+ } else if (playerInfo.statusFlag < 4 || (roomInfo.statusFlag >= 2 && roomInfo.statusFlag < 4)) {
|
|
|
tishiStr = '结算中';
|
|
|
} else if (playerInfo.statusFlag < 2) {
|
|
|
tishiStr = '准备中';
|
|
|
@@ -252,16 +232,16 @@ class houseItem extends StatelessWidget {
|
|
|
} else {
|
|
|
if (roomInfo.statusFlag == 0) {
|
|
|
tishiStr = '未开始';
|
|
|
- tishiColor=Theme.of(context).primaryColor;
|
|
|
+ tishiColor = Theme.of(context).primaryColor;
|
|
|
} else if (roomInfo.statusFlag == 2) {
|
|
|
tishiStr = '进行中';
|
|
|
- tishiColor=Color(0xFFA9AABA);
|
|
|
+ tishiColor = Color(0xFFA9AABA);
|
|
|
} else if (roomInfo.statusFlag == 4) {
|
|
|
tishiStr = '已结束';
|
|
|
- tishiColor=Color(0xFF595B77);
|
|
|
+ tishiColor = Color(0xFF595B77);
|
|
|
} else {
|
|
|
tishiStr = '结算中';
|
|
|
- tishiColor=Color(0xFF595B77);
|
|
|
+ tishiColor = Color(0xFF595B77);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -305,34 +285,32 @@ class houseItem extends StatelessWidget {
|
|
|
maxWidth: 170,
|
|
|
child: Text(
|
|
|
roomInfo.houseName,
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
),
|
|
|
),
|
|
|
Container(
|
|
|
- margin: EdgeInsets.only(left: 6),
|
|
|
- child: Image.network(roomInfo.houseLevel.icon,
|
|
|
- width: 14),
|
|
|
+ width: 5,
|
|
|
),
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(left: 1),
|
|
|
- child: Text(
|
|
|
- roomInfo.houseLevel.levelName,
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xFFF9D881), fontSize: 9),
|
|
|
- )),
|
|
|
+ ScoreType(roomInfo.scoreType)
|
|
|
+ // Container(
|
|
|
+ // margin: EdgeInsets.only(left: 6),
|
|
|
+ // child: Image.network(roomInfo.houseLevel.icon,
|
|
|
+ // width: 14),
|
|
|
+ // ),
|
|
|
+ // Container(
|
|
|
+ // margin: EdgeInsets.only(left: 1),
|
|
|
+ // child: Text(
|
|
|
+ // roomInfo.houseLevel.levelName,
|
|
|
+ // style: TextStyle(
|
|
|
+ // color: Color(0xFFF9D881), fontSize: 9),
|
|
|
+ // )),
|
|
|
],
|
|
|
),
|
|
|
Text(
|
|
|
roomInfo.houseAbstract ?? '',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 12,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
- color: Color(0xFF9BA0AE)),
|
|
|
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
|
|
|
maxLines: 2,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
)
|
|
|
@@ -341,29 +319,21 @@ class houseItem extends StatelessWidget {
|
|
|
),
|
|
|
imageSrc != ''
|
|
|
? Image.asset(imageSrc)
|
|
|
- : (
|
|
|
- type==2?Text(tishiStr,
|
|
|
- style: TextStyle(
|
|
|
- color:
|
|
|
- isImport ? PRIMARY_COLOR : Colors.white54,
|
|
|
- fontSize: 14)):Container(
|
|
|
- color: tishiColor,
|
|
|
- padding: EdgeInsets.symmetric(vertical: 4,horizontal: 9),
|
|
|
- child: Text(tishiStr,style: TextStyle(
|
|
|
- color: Color(0xFF252532),
|
|
|
- fontSize: 12
|
|
|
- ),),
|
|
|
- )
|
|
|
- )
|
|
|
+ : (type == 2
|
|
|
+ ? Text(tishiStr, style: TextStyle(color: isImport ? PRIMARY_COLOR : Colors.white54, fontSize: 14))
|
|
|
+ : Container(
|
|
|
+ color: tishiColor,
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 4, horizontal: 9),
|
|
|
+ child: Text(
|
|
|
+ tishiStr,
|
|
|
+ style: TextStyle(color: Color(0xFF252532), fontSize: 12),
|
|
|
+ ),
|
|
|
+ ))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- CupertinoPageRoute(
|
|
|
- builder: (context) =>
|
|
|
- RoomInfo(roomId: roomInfo.id.toString())));
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
|
|
|
},
|
|
|
),
|
|
|
),
|