rank_introduce.dart 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:sport/bean/rank_game_info.dart';
  4. import 'package:sport/widgets/appbar.dart';
  5. import 'package:sport/widgets/space.dart';
  6. class RankIntroduce extends StatefulWidget {
  7. RankGameInfoData data;
  8. RankIntroduce(this.data);
  9. @override
  10. State<StatefulWidget> createState() {
  11. // TODO: implement createState
  12. return _RankIntroduceState();
  13. }
  14. }
  15. class _RankIntroduceState extends State<RankIntroduce> {
  16. @override
  17. Widget build(BuildContext context) {
  18. return Scaffold(
  19. backgroundColor: Colors.white,
  20. body: CustomScrollView(slivers: <Widget>[
  21. buildSliverAppBar(context, "榜单说明",),
  22. SliverToBoxAdapter(
  23. child: Padding(
  24. padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 20),
  25. child: Column(
  26. children: <Widget>[
  27. Padding(
  28. padding: const EdgeInsets.symmetric(horizontal: 4.0),
  29. child: Row(
  30. children: <Widget>[
  31. Text("榜单名称:",style: Theme.of(context).textTheme.subtitle1),
  32. Expanded(
  33. child: Text("${widget.data.rank.name}",style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff666666))
  34. ),
  35. )
  36. ],
  37. ),
  38. ),
  39. Divider(),
  40. Padding(
  41. padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 4.0),
  42. child: Row(
  43. crossAxisAlignment: CrossAxisAlignment.start,
  44. children: <Widget>[
  45. Text("榜单说明:",style: Theme.of(context).textTheme.subtitle1),
  46. Expanded(child: Text("${widget.data.rank.introduceDetail}",style: Theme.of(context).textTheme.bodyText2))
  47. ],
  48. ),
  49. ),
  50. Divider(),
  51. Padding(
  52. padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 4.0),
  53. child: Row(
  54. crossAxisAlignment: CrossAxisAlignment.start,
  55. children: <Widget>[
  56. Text("标语:",style: Theme.of(context).textTheme.subtitle1),
  57. Expanded(
  58. child: Text("${widget.data.rank.slogan}",style: Theme.of(context).textTheme.bodyText2),
  59. )
  60. ],
  61. ),
  62. ),
  63. Divider(),
  64. Padding(
  65. padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 4.0),
  66. child: Row(
  67. crossAxisAlignment: CrossAxisAlignment.start,
  68. children: <Widget>[
  69. Text("评定规则:",style: Theme.of(context).textTheme.subtitle1),
  70. Expanded(
  71. child: Text("${widget.data.rank.rule}",style: Theme.of(context).textTheme.bodyText2),
  72. )
  73. ],
  74. ),
  75. ),
  76. Divider(),
  77. Padding(
  78. padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 4.0),
  79. child: Row(
  80. crossAxisAlignment: CrossAxisAlignment.start,
  81. children: <Widget>[
  82. Text("奖励明细:",style: Theme.of(context).textTheme.subtitle1),
  83. Expanded(
  84. child: Column(
  85. children: widget.data.rank.reward.map((e) => Column(children: <Widget>[Row(
  86. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  87. children: <Widget>[
  88. Text("第${e.begin}-${e.end}名",style: Theme.of(context).textTheme.bodyText2),
  89. Text("+${e.score} 积分",style: Theme.of(context).textTheme.subtitle1
  90. .copyWith(color: Theme.of(context).accentColor))
  91. ],), Space(height: 3.0,),],)).toList(),
  92. ),
  93. )
  94. ],
  95. )
  96. ),
  97. Divider(),
  98. Padding(
  99. padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 4.0),
  100. child: Row(
  101. crossAxisAlignment: CrossAxisAlignment.start,
  102. children: <Widget>[
  103. Text("奖励发放:",style: Theme.of(context).textTheme.subtitle1),
  104. Expanded(
  105. child: Text("${widget.data.rank.distribute}",style: Theme.of(context).textTheme.bodyText2),
  106. )
  107. ],
  108. ),
  109. ),
  110. ],
  111. ),
  112. )
  113. )
  114. ]));
  115. }
  116. }