TipInfo.dart 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'dart:ui';
  4. import '../styles/totast.dart';
  5. import '../model/SystemNotice.dart';
  6. import '../net/HttpManager.dart';
  7. import '../net/Result.dart';
  8. import '../model/HouseInfo.dart';
  9. import '../model/GameInfo.dart';
  10. import '../widget/SuccessfulReception.dart';
  11. import '../widget/LinearButton.dart';
  12. import '../model/PlayerInfo.dart';
  13. import '../widget/HouseItem.dart';
  14. import '../redux/AppState.dart';
  15. import 'package:flutter_redux/flutter_redux.dart';
  16. import 'Appeal.dart';
  17. import 'dart:io';
  18. class TipInfo extends StatefulWidget {
  19. TipInfo({Key key, this.tipId}) : super(key: key);
  20. final int tipId;
  21. @override
  22. TipInfoState createState() => TipInfoState();
  23. }
  24. class TipInfoState extends State<TipInfo> {
  25. SystemNotice tipInfo = SystemNotice.fromJson({'content': '', 'createTime': DateTime.now().microsecondsSinceEpoch});
  26. HouseInfo houseInfo;
  27. PlayerInfo playerInfo;
  28. bool canAppeal = false;
  29. int appealState = 0;
  30. Future<void> getInfo() async {
  31. Toast.show(context, '加载中', -1, 'loading');
  32. Result res = await HttpManager.get('systemNotice/getOne', data: {'id': widget.tipId});
  33. Toast.hide();
  34. if (res.success) {
  35. setState(() {
  36. tipInfo = SystemNotice.fromJson(res.data);
  37. });
  38. }
  39. if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2 && tipInfo.typeFlag != 3) {
  40. HttpManager.post('systemNotice/update', data: {'id': tipInfo.id, 'statusFlag': 1});
  41. }
  42. if (tipInfo.typeFlag == 3) {
  43. return;
  44. }
  45. Result res2 = await HttpManager.get('houseInfo/getOne', data: {'id': tipInfo.houseId});
  46. if (res2.success) {
  47. setState(() {
  48. houseInfo = HouseInfo.fromJson(res2.data);
  49. });
  50. }
  51. Result res3 =
  52. await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': tipInfo.houseId});
  53. if (res3.success) {
  54. playerInfo = PlayerInfo.fromJson(res3.data);
  55. print(res3.data);
  56. }
  57. HttpManager.get('appealInfo/getOne', data: {
  58. 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
  59. 'playerInfoId': playerInfo.id,
  60. }).then((res) {
  61. if (res.success && res.data != null) {
  62. setState(() {
  63. canAppeal = true;
  64. appealState = 1;
  65. });
  66. } else {
  67. setState(() {
  68. canAppeal = true;
  69. appealState = 0;
  70. });
  71. }
  72. });
  73. // if (tipInfo.typeFlag == 2 || tipInfo.typeFlag == 3) {
  74. // if (tipInfo.statusFlag == 0) {
  75. // showSuccess(tipInfo.playerInfo.bonus, playerInfo.id);
  76. // }
  77. // }
  78. }
  79. void showSuccess(money, playerId) {
  80. Navigator.of(context).push(
  81. PageRouteBuilder(
  82. opaque: false,
  83. transitionDuration: Duration(milliseconds: 300),
  84. transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
  85. return FadeTransition(
  86. opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
  87. child: child,
  88. );
  89. },
  90. pageBuilder: (BuildContext context, _, __) {
  91. return SuccessfulReception(money: money, playerId: playerId);
  92. },
  93. ),
  94. );
  95. }
  96. @override
  97. void initState() {
  98. super.initState();
  99. Future.delayed(Duration.zero, () => getInfo());
  100. }
  101. @override
  102. Widget build(BuildContext context) {
  103. int type = tipInfo.typeFlag != null ? tipInfo.typeFlag : 0;
  104. int status = tipInfo.statusFlag ?? 0;
  105. GameInfo gameInfo;
  106. if (tipInfo.gameInfo != null) {
  107. gameInfo = tipInfo.gameInfo;
  108. }
  109. return WillPopScope(
  110. child: Scaffold(
  111. appBar: AppBar(
  112. // backgroundColor: PRIMARY_COLOR,
  113. title: Text('通知详情'),
  114. centerTitle: true,
  115. elevation: 0,
  116. ),
  117. body: Container(
  118. color: Color(0xFF2B2B42),
  119. width: double.infinity,
  120. height: double.infinity,
  121. child: SingleChildScrollView(
  122. child: Column(
  123. children: <Widget>[
  124. Padding(
  125. padding: EdgeInsets.only(left: 15, right: 15),
  126. child: Column(
  127. crossAxisAlignment: CrossAxisAlignment.start,
  128. children: <Widget>[
  129. Padding(
  130. padding: EdgeInsets.symmetric(vertical: 12),
  131. child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
  132. ),
  133. Container(
  134. height: 1,
  135. color: Colors.black26,
  136. ),
  137. Padding(
  138. padding: EdgeInsets.only(top: 10, bottom: 0),
  139. child: Text.rich(TextSpan(style: TextStyle(color: Colors.white, fontSize: 14), children: _tipContent(tipInfo.content, context)))),
  140. ],
  141. ),
  142. ),
  143. Container(
  144. height: 30,
  145. ),
  146. // tipInfo.typeFlag == 4
  147. // ? Padding(
  148. // padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  149. // child: DefaultTextStyle(
  150. // style: TextStyle(
  151. // fontSize: 13,
  152. // color: Colors.white54,
  153. // ),
  154. // child: Column(
  155. // crossAxisAlignment: CrossAxisAlignment.start,
  156. // children: <Widget>[
  157. // Text('造成此情况等原因可能是:'),
  158. // Text('1、确认开始游戏后没有授权系统进行录屏'),
  159. // Text('2、视频没有录制到最后的分数名次结算页面就回到APP点击完成比赛了 '),
  160. // Text('3、在游戏过程中,猿人点击APP后台进程被退出 '),
  161. // Text('4、没有实际进行游戏比赛 '),
  162. // Text('5、使用作弊手段录制视频'),
  163. // ],
  164. // ),
  165. // ),
  166. // )
  167. // : Container(),
  168. // tipInfo.typeFlag == 5
  169. // ? Padding(
  170. // padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  171. // child: DefaultTextStyle(
  172. // style: TextStyle(
  173. // fontSize: 13,
  174. // color: Colors.white54,
  175. // ),
  176. // child: Column(
  177. // crossAxisAlignment: CrossAxisAlignment.start,
  178. // children: <Widget>[
  179. // Text('造成此情况等原因可能是:'),
  180. // Text('1、游戏结束后没有在规定时间内返回APP点击完成比赛按钮'),
  181. // ],
  182. // ),
  183. // ),
  184. // )
  185. // : Container(
  186. // height: 30,
  187. // ),
  188. // houseInfo != null && tipInfo.typeFlag != 4 && tipInfo.typeFlag != 5 ? RankContent(roomId: houseInfo.id.toString()) : Container(),
  189. houseInfo != null && type != 3
  190. ? HouseItem(
  191. houseInfo,
  192. gameInfo,
  193. playerInfo: playerInfo,
  194. )
  195. : Container(),
  196. houseInfo != null && playerInfo != null && type != 3
  197. ? (playerInfo != null && (type == 4 || type == 0)
  198. ? ( type == 0?Container(
  199. margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
  200. padding: EdgeInsets.all(15),
  201. // height: 239,
  202. width: double.infinity,
  203. decoration: BoxDecoration(
  204. color: Color(0xFF3A3E61),
  205. borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
  206. child: Column(
  207. crossAxisAlignment: CrossAxisAlignment.start,
  208. children: <Widget>[
  209. Text(
  210. '造成此情况等原因可能是:',
  211. style: TextStyle(color: Colors.white54, fontSize: 13),
  212. ),
  213. Container(
  214. height: 10,
  215. ),
  216. Text(
  217. '1、倒计时结束内未点击开始',
  218. style: TextStyle(color: Colors.white, fontSize: 13),
  219. ),
  220. ],
  221. ),
  222. ):Container(
  223. margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
  224. padding: EdgeInsets.all(15),
  225. // height: 239,
  226. width: double.infinity,
  227. decoration: BoxDecoration(
  228. color: Color(0xFF3A3E61),
  229. borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
  230. child: Column(
  231. crossAxisAlignment: CrossAxisAlignment.start,
  232. children: <Widget>[
  233. Text(
  234. '造成此情况等原因可能是:',
  235. style: TextStyle(color: Colors.white54, fontSize: 13),
  236. ),
  237. Container(
  238. height: 10,
  239. ),
  240. Text(
  241. '1、游戏中杀戮人数未到房间任务要求',
  242. style: TextStyle(color: Colors.white, fontSize: 13),
  243. ),
  244. Text(
  245. '2、没有实际进行游戏比赛 ',
  246. style: TextStyle(color: Colors.white, fontSize: 13),
  247. ),
  248. Text(
  249. '3、使用作弊手段进行游戏 ',
  250. style: TextStyle(color: Colors.white, fontSize: 13),
  251. ),
  252. Text(
  253. '4、手机性能或电量过低,在运行和平精英游戏时自动将我们平台APP从后台进程中退掉 ',
  254. style: TextStyle(color: Colors.white, fontSize: 13),
  255. ),
  256. Text(
  257. '5、游戏时间过长,没有在最大时间内返回平台APP点击结束游戏 ',
  258. style: TextStyle(color: Colors.white, fontSize: 13),
  259. ),
  260. ],
  261. ),
  262. ))
  263. : _resultContent(houseInfo, playerInfo, tipInfo.typeFlag))
  264. : Container(),
  265. // (type == 2 || type == 3)
  266. // ? Container(
  267. // width: double.infinity,
  268. // height: 48,
  269. // padding: EdgeInsets.symmetric(horizontal: 15),
  270. // child: status == 0
  271. // ? LinearButton(
  272. // btntext: '立即领取',
  273. // onTapHomeMenu: () async {
  274. // Toast.show(context, '加载中', -1, 'loading');
  275. // Result res = type == 2
  276. // ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
  277. // : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
  278. // Toast.hide();
  279. // if (res.success) {
  280. // if (tipInfo.playerInfo != null) {
  281. // showSuccess(tipInfo.playerInfo.bonus);
  282. // } else {
  283. // showSuccess(tipInfo.bonus);
  284. // }
  285. // getInfo();
  286. // } else {
  287. // Toast.show(context, res.error, 1000, 'info');
  288. // }
  289. // },
  290. // )
  291. // : LinearButton(btntext: '已领取', colorList: [Color(0xFFC99C09), Color(0xFFC7873E)], textColor: Color(0xFF252532)),
  292. // )
  293. // RaisedButton(
  294. // textColor: Colors.white,
  295. // disabledColor: Color(0xFF763939),
  296. // disabledTextColor: Color(0xFF252532),
  297. // child: Text(status==0?'立即领取':'已领取'),
  298. // onPressed: status==0?() async {
  299. // Toast.show(context, '加载中', -1, 'loading');
  300. // Result res = type == 2
  301. // ? await HttpManager.post('playerInfo/receive',
  302. // data: {'id': tipInfo.playerId})
  303. // : await HttpManager.post('systemNotice/receive',
  304. // data: {'id': widget.tipId});
  305. // Toast.hide();
  306. // if (res.success) {
  307. // if (tipInfo.playerInfo != null) {
  308. // showSuccess(tipInfo.playerInfo.bonus);
  309. // } else {
  310. // showSuccess(tipInfo.bonus);
  311. // }
  312. // getInfo();
  313. // } else {
  314. // Toast.show(context, res.error, 1000, 'info');
  315. // }
  316. // }:null,
  317. // ),
  318. // : Container(),
  319. // CustomPaint(
  320. // painter: CircleProgressBarPainter(
  321. // Color(0xFFDCA659), Color(0xFFAE4945), 0.0, 270.0, 360.0, 18.0),
  322. // size: Size(108.0, 108.0),
  323. // )
  324. ],
  325. ),
  326. ),
  327. ),
  328. floatingActionButton: _btnContent(),
  329. floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
  330. ),
  331. onWillPop: () {
  332. Navigator.of(context).pop(true);
  333. Toast.hide();
  334. return Future.value(false);
  335. },
  336. );
  337. }
  338. Widget _btnContent() {
  339. if (tipInfo.typeFlag == 2 || tipInfo.typeFlag == 3) {
  340. if (tipInfo.statusFlag == 0) {
  341. return Container(
  342. width: double.infinity,
  343. padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  344. height: 88,
  345. child: LinearButton(
  346. btntext: '立即领取',
  347. onTapHomeMenu: () async {
  348. Toast.show(context, '加载中', -1, 'loading');
  349. Result res = tipInfo.typeFlag == 2
  350. ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
  351. : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
  352. Toast.hide();
  353. if (res.success) {
  354. showSuccess(tipInfo.playerInfo.bonus, playerInfo.id);
  355. getInfo();
  356. } else {
  357. Toast.show(context, res.error, 1000, 'info');
  358. }
  359. },
  360. ));
  361. } else {
  362. return Container(
  363. width: double.infinity,
  364. padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  365. height: 88,
  366. child: LinearButton(btntext: '已领取', colorList: [Color(0xFFB34A4A), Color(0xFFB34A4A)], textColor: Color(0xFF252532)));
  367. }
  368. } else if ((tipInfo.typeFlag == 4 || tipInfo.typeFlag == 5 || (playerInfo != null && playerInfo.dataError)) && canAppeal && appealState == 0) {
  369. return Container(
  370. width: double.infinity,
  371. padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  372. height: 88,
  373. child: LinearButton(
  374. btntext: '申诉结果',
  375. colorList: [Color(0xFFAF4946), Color(0xFFAF4946)],
  376. textColor: Colors.white,
  377. onTapHomeMenu: () async {
  378. final success = await Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
  379. if (success != null && success) {
  380. Toast.show(context, '提交成功', 1500, 'success');
  381. setState(() {
  382. appealState = 1;
  383. });
  384. }
  385. },
  386. ));
  387. } else if (tipInfo.typeFlag != 3 && canAppeal && appealState == 1) {
  388. return Container(
  389. width: double.infinity,
  390. padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
  391. height: 88,
  392. child: LinearButton(btntext: '已提交申诉', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
  393. } else {
  394. return Container();
  395. }
  396. }
  397. List<TextSpan> _tipContent(content, context) {
  398. // String content = '很遗憾,你在2019-06-05 09:23开始的游戏竞赛 [15166的吃鸡房间],[无有效结果],无法获得奖励,该局参赛人数[2]人。';
  399. List<String> contentlist1 = content.split('[');
  400. List<Map> totalContent = [];
  401. contentlist1.forEach((item) {
  402. List _list = item.split(']');
  403. if (_list.length > 1) {
  404. totalContent.add({
  405. "content": _list[0],
  406. "isImport": true,
  407. });
  408. totalContent.add({
  409. "content": _list[1],
  410. "isImport": false,
  411. });
  412. } else {
  413. totalContent.add({
  414. "content": _list[0],
  415. "isImport": false,
  416. });
  417. }
  418. });
  419. List<TextSpan> _widgetList = [];
  420. totalContent.forEach((item) {
  421. if (item['isImport']) {
  422. _widgetList.add(TextSpan(text: ' ' + item['content'] + ' ', style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w600)));
  423. } else {
  424. _widgetList.add(TextSpan(text: item['content']));
  425. }
  426. });
  427. return _widgetList;
  428. }
  429. Widget _resultContent(HouseInfo houseInfo, PlayerInfo playerInfo, int typeFlag) {
  430. List jiangpaiImg = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
  431. String img = '';
  432. if (playerInfo != null) {
  433. if (playerInfo.medal == 'platinum') {
  434. img = jiangpaiImg[3];
  435. } else if (playerInfo.medal == 'gold') {
  436. img = jiangpaiImg[0];
  437. } else if (playerInfo.medal == 'silver') {
  438. img = jiangpaiImg[1];
  439. } else if (playerInfo.medal == 'bronze') {
  440. img = jiangpaiImg[2];
  441. }
  442. }
  443. return Column(children: <Widget>[
  444. Container(
  445. margin: EdgeInsets.symmetric(vertical: 5, horizontal: 15),
  446. padding: EdgeInsets.all(15),
  447. height: 140,
  448. decoration: BoxDecoration(color: Color(0xFF3A3E61), borderRadius: BorderRadius.all(Radius.circular(4))),
  449. child: Column(
  450. crossAxisAlignment: CrossAxisAlignment.start,
  451. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  452. children: <Widget>[
  453. Text('比赛结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
  454. Row(
  455. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  456. children: <Widget>[
  457. Text("参数成员 ", style: TextStyle(color: Colors.white, fontSize: 14)),
  458. Text("${houseInfo.playerNumber}人 ", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
  459. ],
  460. ),
  461. Row(
  462. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  463. children: <Widget>[
  464. Text("我的排名", style: TextStyle(color: Colors.white, fontSize: 14)),
  465. Text("${playerInfo.houseRank}", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
  466. ],
  467. ),
  468. Row(
  469. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  470. children: <Widget>[
  471. Text("获得积分 ", style: TextStyle(color: Colors.white, fontSize: 14)),
  472. Row(
  473. children: <Widget>[
  474. Image.asset('images/icon_jifen.png'),
  475. Text('x${playerInfo.bonus}', style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
  476. ],
  477. )
  478. ],
  479. )
  480. ],
  481. ),
  482. )
  483. ]);
  484. }
  485. }
  486. //比赛结束排名
  487. class RankContent extends StatefulWidget {
  488. RankContent({Key key, this.roomId}) : super(key: key);
  489. final String roomId; // 用来储存传递过来的值
  490. @override
  491. RankContentState createState() => RankContentState();
  492. }
  493. class RankContentState extends State<RankContent> {
  494. List<PlayerInfo> topList = [];
  495. Future<void> getTopList() async {
  496. Toast.show(context, '加载中', -1, 'loading');
  497. Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
  498. Toast.hide();
  499. List<PlayerInfo> list = [];
  500. if (res.success) {
  501. for (var item in res.data['pp']) {
  502. PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
  503. list.add(jonPlayer);
  504. }
  505. } else {}
  506. setState(() {
  507. topList = list;
  508. });
  509. }
  510. @override
  511. void initState() {
  512. super.initState();
  513. Future.delayed(Duration.zero, () {
  514. getTopList();
  515. });
  516. }
  517. @override
  518. Widget build(BuildContext context) {
  519. return Container(
  520. width: double.infinity,
  521. height: 180,
  522. margin: EdgeInsets.only(top: 15),
  523. child: Row(
  524. mainAxisAlignment: MainAxisAlignment.center,
  525. crossAxisAlignment: CrossAxisAlignment.end,
  526. children: <Widget>[_rankItem(2), _rankItem(1), _rankItem(3)],
  527. ),
  528. );
  529. }
  530. Widget _rankItem(int _num) {
  531. if (_num > topList.length) {
  532. return Container(
  533. width: 107,
  534. height: 60,
  535. );
  536. }
  537. List colorList = [
  538. [Color(0xFFD48E00), Color(0xFFFECF01)],
  539. [Color(0xFFC5C5C5), Color(0xFFE3E3E3)],
  540. [Color(0xFFE77023), Color(0xFFF89E58)]
  541. ];
  542. List imgList = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png'];
  543. return Container(
  544. padding: EdgeInsets.only(left: 15, right: 15, top: _num == 1 ? 0 : 15),
  545. width: 107,
  546. child: Column(
  547. crossAxisAlignment: CrossAxisAlignment.center,
  548. children: <Widget>[
  549. Container(
  550. child: Stack(
  551. children: <Widget>[
  552. Container(
  553. margin: EdgeInsets.only(top: 17, bottom: 20),
  554. width: _num == 1 ? 70 : 60,
  555. height: _num == 1 ? 70 : 60,
  556. decoration: BoxDecoration(
  557. gradient: LinearGradient(colors: colorList[_num - 1], begin: Alignment.topLeft, end: Alignment.bottomRight),
  558. borderRadius: BorderRadius.all(Radius.circular(100)),
  559. ),
  560. child: Center(
  561. child: Container(
  562. width: _num == 1 ? 60 : 50,
  563. height: _num == 1 ? 60 : 50,
  564. child: CircleAvatar(backgroundImage: NetworkImage(topList[_num - 1].userInfo.icon)),
  565. )),
  566. ),
  567. Positioned(
  568. bottom: 0,
  569. child: Center(
  570. child: Image.asset(
  571. 'images/ph_yinpai_no' + '$_num.png',
  572. width: 67,
  573. ),
  574. ),
  575. ),
  576. Positioned(
  577. top: 0,
  578. left: _num == 1 ? 19 : 14,
  579. child: Center(
  580. child: Image.asset(
  581. imgList[_num - 1],
  582. ),
  583. ),
  584. ),
  585. ],
  586. ),
  587. ),
  588. Text(
  589. topList[_num - 1].userInfo.nickname,
  590. style: TextStyle(
  591. color: Color(0xFFFDC372),
  592. fontSize: 12,
  593. ),
  594. overflow: TextOverflow.ellipsis,
  595. textAlign: TextAlign.center,
  596. ),
  597. // SizedBox(
  598. // height: 5,
  599. // ),
  600. // Row(
  601. // mainAxisAlignment: MainAxisAlignment.center,
  602. // children: <Widget>[
  603. // Image.asset('images/icon_jinbi_xiao_hong.png', width: 20),
  604. // Text('×' + (topList[_num - 1].bonus != null ? topList[_num - 1].bonus.toString() : '0'), style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
  605. // ],
  606. // )
  607. ],
  608. ),
  609. );
  610. }
  611. }