|
|
@@ -177,12 +177,13 @@ class RankListState extends State<RankList> {
|
|
|
floating: true,
|
|
|
delegate: _SliverAppBarDelegate(
|
|
|
minHeight: 66, //收起的高度
|
|
|
- maxHeight:66, //展开的最大高度
|
|
|
+ maxHeight: 66, //展开的最大高度
|
|
|
child: RankItem(
|
|
|
myPlayInfo,
|
|
|
myPlayInfo.rank,
|
|
|
height: 66,
|
|
|
color: 0xFF23253C,
|
|
|
+ border:false
|
|
|
)),
|
|
|
),
|
|
|
_sliverList()
|
|
|
@@ -462,62 +463,67 @@ class RankListState extends State<RankList> {
|
|
|
}
|
|
|
|
|
|
class RankItem extends StatelessWidget {
|
|
|
- RankItem(this.playerInfo, this.index, {this.color = 0, this.height = 66.0});
|
|
|
+ RankItem(this.playerInfo, this.index, {this.color = 0, this.height = 66.0,this.border=true});
|
|
|
final PlayerInfo playerInfo;
|
|
|
final int index;
|
|
|
final int color;
|
|
|
final double height;
|
|
|
+ final bool border;
|
|
|
|
|
|
List<String> rankImgList = ['images/icon_paihangbang_01.png', 'images/icon_paihangbang_02.png', 'images/icon_paihangbang_03.png'];
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
|
- height: height,
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 15),
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border(bottom: BorderSide(width: 1, color: Colors.black26, style: BorderStyle.solid)),
|
|
|
- color: color == 0 ? (playerInfo.rank < 4 ? Color(0xFF363759) : Color(0xFF2B2B42)) : Color(color)),
|
|
|
- child: Row(
|
|
|
- children: <Widget>[
|
|
|
- playerInfo.rank < 100
|
|
|
- ? (playerInfo.rank < 4
|
|
|
- ? Padding(
|
|
|
- padding: EdgeInsets.only(right: 15),
|
|
|
- child: Image.asset(rankImgList[playerInfo.rank - 1]),
|
|
|
- )
|
|
|
- : Container(
|
|
|
- width: 30,
|
|
|
- height: 30,
|
|
|
- margin: EdgeInsets.only(right: 15),
|
|
|
- decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/icon_paihangbang_04_huangse.png'), fit: BoxFit.cover)),
|
|
|
- child: Text(
|
|
|
- playerInfo.rank.toString(),
|
|
|
- style: TextStyle(color: Color(0xFF15151D), fontSize: 12, fontWeight: FontWeight.w500, height: 2),
|
|
|
- textAlign: TextAlign.center,
|
|
|
- ),
|
|
|
- ))
|
|
|
- : Container(),
|
|
|
- Container(
|
|
|
- width: 36,
|
|
|
- height: 36,
|
|
|
- margin: EdgeInsets.only(right: 15),
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage: NetworkImage(playerInfo.userInfo.icon),
|
|
|
- ),
|
|
|
+ height: height,
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 15),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ // border: Border(bottom: BorderSide(width: 1, color: Colors.black26, style: BorderStyle.solid)),
|
|
|
+ color: color == 0 ? Color(0xFF2E3049) : Color(color)),
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border(bottom: BorderSide(width: border?1:0, color: Colors.black26, style: BorderStyle.solid)),
|
|
|
),
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: Text(playerInfo.userInfo.nickname,
|
|
|
- style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 14, height: 1.2), overflow: TextOverflow.ellipsis),
|
|
|
+ child: Row(
|
|
|
+ children: <Widget>[
|
|
|
+ playerInfo.rank < 100
|
|
|
+ ? (playerInfo.rank < 4
|
|
|
+ ? Padding(
|
|
|
+ padding: EdgeInsets.only(right: 15),
|
|
|
+ child: Image.asset(rankImgList[playerInfo.rank - 1]),
|
|
|
+ )
|
|
|
+ : Container(
|
|
|
+ width: 30,
|
|
|
+ height: 30,
|
|
|
+ margin: EdgeInsets.only(right: 15),
|
|
|
+ decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/icon_paihangbang_04_huangse.png'), fit: BoxFit.cover)),
|
|
|
+ child: Text(
|
|
|
+ playerInfo.rank.toString(),
|
|
|
+ style: TextStyle(color: Color(0xFF15151D), fontSize: 12, fontWeight: FontWeight.w500, height: 2),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ ),
|
|
|
+ ))
|
|
|
+ : Container(),
|
|
|
+ Container(
|
|
|
+ width: 36,
|
|
|
+ height: 36,
|
|
|
+ margin: EdgeInsets.only(right: 15),
|
|
|
+ child: CircleAvatar(
|
|
|
+ backgroundImage: NetworkImage(playerInfo.userInfo.icon),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ flex: 1,
|
|
|
+ child: Text(playerInfo.userInfo.nickname,
|
|
|
+ style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 14, height: 1.2), overflow: TextOverflow.ellipsis),
|
|
|
+ ),
|
|
|
+ Medal(playerInfo.getPlatinum(), '铂金'),
|
|
|
+ Medal(playerInfo.getGold(), '金牌'),
|
|
|
+ Medal(playerInfo.getSilver(), '银牌'),
|
|
|
+ Medal(playerInfo.getBronze(), '铜牌'),
|
|
|
+ ],
|
|
|
),
|
|
|
- Medal(playerInfo.getPlatinum(), '铂金'),
|
|
|
- Medal(playerInfo.getGold(), '金牌'),
|
|
|
- Medal(playerInfo.getSilver(), '银牌'),
|
|
|
- Medal(playerInfo.getBronze(), '铜牌'),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ ));
|
|
|
}
|
|
|
}
|
|
|
|