|
|
@@ -28,13 +28,8 @@ class RankListState extends State<RankList> {
|
|
|
PlayerInfo myPlayInfo;
|
|
|
|
|
|
void getUserRank() async {
|
|
|
- print('***********');
|
|
|
-
|
|
|
- Result res = await HttpManager.get("playerInfo/seasonUserRank", data: {
|
|
|
- "seasonId": raceId,
|
|
|
- "userId": StoreProvider.of<AppState>(context).state.userInfo.id
|
|
|
- });
|
|
|
- print(res.data);
|
|
|
+ Result res =
|
|
|
+ await HttpManager.get("playerInfo/seasonUserRank", data: {"seasonId": raceId, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
|
|
|
if (res.success && res.data != null) {
|
|
|
setState(() {
|
|
|
myPlayInfo = PlayerInfo.fromJson(res.data);
|
|
|
@@ -52,11 +47,7 @@ class RankListState extends State<RankList> {
|
|
|
void getListPage() async {
|
|
|
scrollFlag = false;
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res = await HttpManager.get("playerInfo/seasonRankPage", data: {
|
|
|
- "seasonId": raceId,
|
|
|
- "currentPage": currentPage,
|
|
|
- "pageNumber": 20
|
|
|
- });
|
|
|
+ Result res = await HttpManager.get("playerInfo/seasonRankPage", data: {"seasonId": raceId, "currentPage": currentPage, "pageNumber": 20});
|
|
|
Toast.hide();
|
|
|
List<PlayerInfo> list = rankList;
|
|
|
if (currentPage == 1) {
|
|
|
@@ -128,8 +119,7 @@ class RankListState extends State<RankList> {
|
|
|
super.initState();
|
|
|
_mcontroller = ScrollController();
|
|
|
_mcontroller.addListener(() {
|
|
|
- if (_mcontroller.position.pixels ==
|
|
|
- _mcontroller.position.maxScrollExtent) {
|
|
|
+ if (_mcontroller.position.pixels == _mcontroller.position.maxScrollExtent) {
|
|
|
if (scrollFlag) {
|
|
|
currentPage++;
|
|
|
getListPage();
|
|
|
@@ -137,9 +127,8 @@ class RankListState extends State<RankList> {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- Future.delayed(Duration(milliseconds: 100), () => getUserRank());
|
|
|
-
|
|
|
- Future.delayed(Duration.zero, () {
|
|
|
+ Future.delayed(Duration.zero, () {
|
|
|
+ getUserRank();
|
|
|
getSeasonInfo();
|
|
|
});
|
|
|
}
|
|
|
@@ -158,7 +147,7 @@ class RankListState extends State<RankList> {
|
|
|
color: BG_SUB_COLOR,
|
|
|
child: RefreshIndicator(
|
|
|
color: PRIMARY_COLOR,
|
|
|
- backgroundColor: BG_COLOR,
|
|
|
+ backgroundColor: Colors.white,
|
|
|
onRefresh: () async {
|
|
|
await new Future.delayed(const Duration(seconds: 1));
|
|
|
getUserRank();
|
|
|
@@ -166,11 +155,7 @@ class RankListState extends State<RankList> {
|
|
|
child: CustomScrollView(
|
|
|
controller: _mcontroller,
|
|
|
physics: AlwaysScrollableScrollPhysics(),
|
|
|
- slivers: <Widget>[
|
|
|
- _sliverAppBar(),
|
|
|
- _slievrToBoxAdapter(),
|
|
|
- _sliverList()
|
|
|
- ],
|
|
|
+ slivers: <Widget>[_sliverAppBar(), _slievrToBoxAdapter(), _sliverList()],
|
|
|
)),
|
|
|
),
|
|
|
floatingActionButton: myPlayInfo == null
|
|
|
@@ -188,42 +173,28 @@ class RankListState extends State<RankList> {
|
|
|
Container(
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage:
|
|
|
- NetworkImage(myPlayInfo.userInfo.icon ?? '')),
|
|
|
+ child: CircleAvatar(backgroundImage: NetworkImage(myPlayInfo.userInfo.icon ?? '')),
|
|
|
),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
|
|
- child: Text(myPlayInfo.userInfo.nickname ?? '',
|
|
|
- style:
|
|
|
- TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
+ child: Text(myPlayInfo.userInfo.nickname ?? '', style: TextStyle(color: Colors.white, fontSize: 14)),
|
|
|
),
|
|
|
Image.asset('images/icon_jinbi_da_bai.png', width: 20),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(left: 2),
|
|
|
- child: Text((myPlayInfo.bonus ?? 0).toString(),
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500)),
|
|
|
+ child: Text((myPlayInfo.bonus ?? 0).toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500)),
|
|
|
),
|
|
|
myPlayInfo.rank == null
|
|
|
? Container()
|
|
|
: Expanded(
|
|
|
flex: 1,
|
|
|
- child: Text(
|
|
|
- '第 ' + myPlayInfo.rank.toString() + ' 名',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500),
|
|
|
- textAlign: TextAlign.right),
|
|
|
+ child: Text('第 ' + myPlayInfo.rank.toString() + ' 名',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500), textAlign: TextAlign.right),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
- floatingActionButtonLocation:
|
|
|
- FloatingActionButtonLocation.centerDocked,
|
|
|
+ floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
|
),
|
|
|
onWillPop: () {
|
|
|
Toast.hide();
|
|
|
@@ -251,10 +222,7 @@ class RankListState extends State<RankList> {
|
|
|
children: <Widget>[
|
|
|
Text(
|
|
|
competitionSeason != null ? competitionSeason.season : '',
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 13,
|
|
|
- fontWeight: FontWeight.w400),
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w400),
|
|
|
),
|
|
|
Image.asset(
|
|
|
'images/icon_zhankai_baise.png',
|
|
|
@@ -273,8 +241,7 @@ class RankListState extends State<RankList> {
|
|
|
},
|
|
|
itemBuilder: (BuildContext context) {
|
|
|
return seasonList.map((choice) {
|
|
|
- return new PopupMenuItem(
|
|
|
- child: new Text(choice.season), value: choice.id);
|
|
|
+ return new PopupMenuItem(child: new Text(choice.season), value: choice.id);
|
|
|
}).toList();
|
|
|
}),
|
|
|
],
|
|
|
@@ -304,12 +271,7 @@ class RankListState extends State<RankList> {
|
|
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
|
|
child: Container(
|
|
|
height: 36,
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border(
|
|
|
- bottom: BorderSide(
|
|
|
- width: 1,
|
|
|
- color: Colors.black26,
|
|
|
- style: BorderStyle.solid))),
|
|
|
+ decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: Colors.black26, style: BorderStyle.solid))),
|
|
|
child: Row(
|
|
|
children: <Widget>[
|
|
|
Container(
|
|
|
@@ -317,8 +279,7 @@ class RankListState extends State<RankList> {
|
|
|
height: 36,
|
|
|
margin: EdgeInsets.only(right: 15),
|
|
|
child: CircleAvatar(
|
|
|
- backgroundImage:
|
|
|
- NetworkImage(rankList[index].userInfo.icon),
|
|
|
+ backgroundImage: NetworkImage(rankList[index].userInfo.icon),
|
|
|
),
|
|
|
),
|
|
|
Expanded(
|
|
|
@@ -328,15 +289,10 @@ class RankListState extends State<RankList> {
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
Text(rankList[index].userInfo.nickname,
|
|
|
- style: TextStyle(
|
|
|
- color: PRIMARY_COLOR,
|
|
|
- fontSize: 14,
|
|
|
- height: 1.2),
|
|
|
- overflow: TextOverflow.ellipsis),
|
|
|
+ style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, height: 1.2), overflow: TextOverflow.ellipsis),
|
|
|
Row(
|
|
|
children: <Widget>[
|
|
|
- Image.asset('images/icon_jinbi_da_bai.png',
|
|
|
- width: 20),
|
|
|
+ Image.asset('images/icon_jinbi_da_bai.png', width: 20),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(left: 2),
|
|
|
child: Text(rankList[index].bonus.toString(),
|
|
|
@@ -356,18 +312,10 @@ class RankListState extends State<RankList> {
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
margin: EdgeInsets.only(right: 33),
|
|
|
- decoration: BoxDecoration(
|
|
|
- image: DecorationImage(
|
|
|
- image: AssetImage(
|
|
|
- 'images/icon_paihangbang_04.png'),
|
|
|
- fit: BoxFit.cover)),
|
|
|
+ decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/icon_paihangbang_04.png'), fit: BoxFit.cover)),
|
|
|
child: Text(
|
|
|
(index + 1).toString(),
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xFF15151D),
|
|
|
- fontSize: 12,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
- height: 2),
|
|
|
+ style: TextStyle(color: Color(0xFF15151D), fontSize: 12, fontWeight: FontWeight.w500, height: 2),
|
|
|
textAlign: TextAlign.center,
|
|
|
),
|
|
|
)
|
|
|
@@ -417,27 +365,15 @@ class RankListState extends State<RankList> {
|
|
|
begin: Alignment.topLeft,
|
|
|
colors: [Color(0xFFFECF01), Color(0xFFD48E00)],
|
|
|
),
|
|
|
- boxShadow: [
|
|
|
- BoxShadow(
|
|
|
- color: Colors.black12,
|
|
|
- offset: Offset(2.0, 4.0),
|
|
|
- blurRadius: 4.0)
|
|
|
- ]),
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage:
|
|
|
- NetworkImage(rankList[0].userInfo.icon))),
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- left: 24,
|
|
|
- child: Image.asset('images/icon_paihangbang_01.png',
|
|
|
- width: 32))
|
|
|
+ boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
|
|
|
+ child: CircleAvatar(backgroundImage: NetworkImage(rankList[0].userInfo.icon))),
|
|
|
+ Positioned(bottom: 0, left: 24, child: Image.asset('images/icon_paihangbang_01.png', width: 32))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(top: 7, bottom: 3),
|
|
|
- child: Text(rankList[0].userInfo.nickname,
|
|
|
- style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
+ child: Text(rankList[0].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
),
|
|
|
Row(
|
|
|
children: <Widget>[
|
|
|
@@ -445,11 +381,7 @@ class RankListState extends State<RankList> {
|
|
|
padding: EdgeInsets.only(right: 2),
|
|
|
child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
|
|
|
),
|
|
|
- Text(rankList[0].bonus.toString(),
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500))
|
|
|
+ Text(rankList[0].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
|
|
|
],
|
|
|
)
|
|
|
],
|
|
|
@@ -474,46 +406,28 @@ class RankListState extends State<RankList> {
|
|
|
width: 70,
|
|
|
height: 70,
|
|
|
decoration: BoxDecoration(
|
|
|
- borderRadius:
|
|
|
- BorderRadius.all(Radius.circular(70)),
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(70)),
|
|
|
gradient: LinearGradient(
|
|
|
begin: Alignment.topLeft,
|
|
|
colors: [Color(0xFFE3E3E3), Color(0xFFC5C5C5)],
|
|
|
),
|
|
|
- boxShadow: [
|
|
|
- BoxShadow(
|
|
|
- color: Colors.black12,
|
|
|
- offset: Offset(2.0, 4.0),
|
|
|
- blurRadius: 4.0)
|
|
|
- ]),
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage:
|
|
|
- NetworkImage(rankList[1].userInfo.icon))),
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- left: 19,
|
|
|
- child: Image.asset('images/icon_paihangbang_02.png',
|
|
|
- width: 32))
|
|
|
+ boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
|
|
|
+ child: CircleAvatar(backgroundImage: NetworkImage(rankList[1].userInfo.icon))),
|
|
|
+ Positioned(bottom: 0, left: 19, child: Image.asset('images/icon_paihangbang_02.png', width: 32))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(top: 7, bottom: 3),
|
|
|
- child: Text(rankList[1].userInfo.nickname,
|
|
|
- style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
+ child: Text(rankList[1].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
),
|
|
|
Row(
|
|
|
children: <Widget>[
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(right: 2),
|
|
|
- child: Image.asset('images/icon_jinbi_da_bai.png',
|
|
|
- width: 20),
|
|
|
+ child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
|
|
|
),
|
|
|
- Text(rankList[1].bonus.toString(),
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500))
|
|
|
+ Text(rankList[1].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
|
|
|
],
|
|
|
)
|
|
|
],
|
|
|
@@ -541,27 +455,15 @@ class RankListState extends State<RankList> {
|
|
|
begin: Alignment.topLeft,
|
|
|
colors: [Color(0xFFF89E58), Color(0xFFE77023)],
|
|
|
),
|
|
|
- boxShadow: [
|
|
|
- BoxShadow(
|
|
|
- color: Colors.black12,
|
|
|
- offset: Offset(2.0, 4.0),
|
|
|
- blurRadius: 4.0)
|
|
|
- ]),
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage:
|
|
|
- NetworkImage(rankList[2].userInfo.icon))),
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- left: 19,
|
|
|
- child: Image.asset('images/icon_paihangbang_03.png',
|
|
|
- width: 32))
|
|
|
+ boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
|
|
|
+ child: CircleAvatar(backgroundImage: NetworkImage(rankList[2].userInfo.icon))),
|
|
|
+ Positioned(bottom: 0, left: 19, child: Image.asset('images/icon_paihangbang_03.png', width: 32))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
Padding(
|
|
|
padding: EdgeInsets.only(top: 7, bottom: 3),
|
|
|
- child: Text(rankList[2].userInfo.nickname,
|
|
|
- style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
+ child: Text(rankList[2].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
|
|
|
),
|
|
|
Row(
|
|
|
children: <Widget>[
|
|
|
@@ -569,11 +471,7 @@ class RankListState extends State<RankList> {
|
|
|
padding: EdgeInsets.only(right: 2),
|
|
|
child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
|
|
|
),
|
|
|
- Text(rankList[2].bonus.toString(),
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.w500))
|
|
|
+ Text(rankList[2].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
|
|
|
],
|
|
|
)
|
|
|
],
|