基础组件库
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

243 linhas
8.1 KiB

  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. ///
  4. /// 我的团队 - 粉丝信息
  5. ///
  6. class TeamFansItem extends StatefulWidget {
  7. @override
  8. _TeamFansItemState createState() => _TeamFansItemState();
  9. }
  10. class _TeamFansItemState extends State<TeamFansItem> {
  11. @override
  12. Widget build(BuildContext context) {
  13. return _getMainWidget();
  14. }
  15. /// 主体视图
  16. Widget _getMainWidget() {
  17. return Container(
  18. decoration: BoxDecoration(color: HexColor.fromHex('#FFFFFF'), borderRadius: BorderRadius.circular(10)),
  19. margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8),
  20. padding: const EdgeInsets.only(left: 20, right: 20, top: 17.5, bottom: 15),
  21. child: Column(
  22. children: <Widget>[
  23. // 粉丝头像信息等
  24. _getFansInfoWidget(),
  25. const SizedBox(height: 10),
  26. // 微信号码
  27. _getWXNumberInfoWidget(),
  28. const SizedBox(height: 10),
  29. // 数据信息
  30. _getDataWidget(),
  31. ],
  32. ),
  33. );
  34. }
  35. /// 粉丝头像信息等
  36. Widget _getFansInfoWidget() {
  37. return Row(
  38. children: <Widget>[
  39. /// 头像
  40. Container(width: 50, height: 50, color: Colors.red),
  41. const SizedBox(width: 10),
  42. /// 信息
  43. Column(
  44. mainAxisAlignment: MainAxisAlignment.center,
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: <Widget>[
  47. /// 会员等级 关系 昵称
  48. RichText(
  49. text: TextSpan(text: '', children: [
  50. /// 等级
  51. WidgetSpan(child: Container(width: 37, height: 13, color: Colors.red)),
  52. /// 会员关系
  53. WidgetSpan(child: Container(width: 13, height: 13, color: Colors.red, margin: const EdgeInsets.only(left: 3, right: 3))),
  54. /// 会员名称
  55. TextSpan(text: '温***哥', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 12, fontWeight: FontWeight.bold))
  56. ]),
  57. ),
  58. /// 手机号码
  59. RichText(
  60. text: TextSpan(text: '', children: [
  61. /// 手机号码
  62. TextSpan(text: '手机号:', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 11)),
  63. TextSpan(text: '124****6124', style: TextStyle(color: HexColor.fromHex('#333333'), fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget')),
  64. /// 复制按钮
  65. WidgetSpan(child: Container(width: 11, height: 11, color: Colors.red, margin: const EdgeInsets.only(left: 3)))
  66. ]),
  67. ),
  68. ],
  69. )
  70. ],
  71. );
  72. }
  73. /// 微信号码信息
  74. Widget _getWXNumberInfoWidget() {
  75. return Container(
  76. padding: const EdgeInsets.only(left: 9, right: 10, bottom: 6.5, top: 6.5),
  77. decoration: BoxDecoration(
  78. color: HexColor.fromHex('#F7F7F7'),
  79. borderRadius: BorderRadius.circular(10),
  80. ),
  81. child: Row(
  82. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  83. children: <Widget>[
  84. /// 微信号码
  85. RichText(
  86. text: TextSpan(text: '微信号:', style: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 11, fontWeight: FontWeight.bold), children: [
  87. TextSpan(
  88. text: '54A78',
  89. style: TextStyle(fontWeight: FontWeight.bold, color: HexColor.fromHex('#333333'), fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget')),
  90. WidgetSpan(child: Container(margin: const EdgeInsets.only(left: 5.5), color: Colors.red, width: 11, height: 11))
  91. ]),
  92. ),
  93. /// 最近登陆时间
  94. Text('最近登陆 2019-06-28', style: TextStyle(color: HexColor.fromHex('#909090'), fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget'))
  95. ],
  96. ),
  97. );
  98. }
  99. /// 数据信息
  100. Widget _getDataWidget() {
  101. return Row(
  102. mainAxisAlignment: MainAxisAlignment.spaceAround,
  103. children: <Widget>[
  104. /// 左边数据
  105. Flexible(
  106. flex: 1,
  107. child: Column(
  108. mainAxisAlignment: MainAxisAlignment.center,
  109. crossAxisAlignment: CrossAxisAlignment.center,
  110. children: <Widget>[
  111. /// 邀请人数(人)
  112. _getCustomWidget(
  113. text: '邀请人数(人)',
  114. textColor: '#333333',
  115. textSize: 10,
  116. number: '1578',
  117. numberColor: '#FF4242',
  118. numberSize: 20,
  119. ),
  120. const SizedBox(height: 15),
  121. /// 今日邀请 & 本月邀请
  122. Row(
  123. mainAxisAlignment: MainAxisAlignment.spaceAround,
  124. children: <Widget>[
  125. /// 今日邀请
  126. _getCustomWidget(
  127. text: '今日邀请',
  128. textColor: '#909090',
  129. textSize: 10,
  130. number: '3258',
  131. numberColor: '#333333',
  132. numberSize: 15,
  133. ),
  134. /// 本月邀请
  135. _getCustomWidget(
  136. text: '本月邀请',
  137. textColor: '#909090',
  138. textSize: 10,
  139. number: '3258',
  140. numberColor: '#333333',
  141. numberSize: 15,
  142. ),
  143. ],
  144. )
  145. ],
  146. ),
  147. ),
  148. /// 分割线
  149. SizedBox( height:65.5, width: 0.5,child: VerticalDivider(width: 0.5, thickness: 0.5, color: HexColor.fromHex('#F7F7F7'))),
  150. /// 右边数据
  151. Flexible(
  152. flex: 1,
  153. child: Column(
  154. mainAxisAlignment: MainAxisAlignment.center,
  155. crossAxisAlignment: CrossAxisAlignment.center,
  156. children: <Widget>[
  157. /// 累计收益(¥)
  158. _getCustomWidget(
  159. text: '累计收益(¥)',
  160. textColor: '#333333',
  161. textSize: 10,
  162. number: '157.54',
  163. numberColor: '#FF4242',
  164. numberSize: 20,
  165. ),
  166. const SizedBox(height: 15),
  167. /// 近7天收益 & 本月收益
  168. Row(
  169. mainAxisAlignment: MainAxisAlignment.spaceAround,
  170. children: <Widget>[
  171. /// 今日邀请
  172. _getCustomWidget(
  173. text: '近7天收益',
  174. textColor: '#909090',
  175. textSize: 10,
  176. number: '4.12',
  177. numberColor: '#333333',
  178. numberSize: 15,
  179. ),
  180. /// 本月邀请
  181. _getCustomWidget(
  182. text: '本月收益',
  183. textColor: '#909090',
  184. textSize: 10,
  185. number: '528.14',
  186. numberColor: '#333333',
  187. numberSize: 15,
  188. ),
  189. ],
  190. )
  191. ],
  192. ),
  193. )
  194. ],
  195. );
  196. }
  197. /// 自定义Widget(数字加粗)
  198. Widget _getCustomWidget({String text, String textColor, double textSize, String number, String numberColor, double numberSize, String icon}) {
  199. return Column(
  200. mainAxisAlignment: MainAxisAlignment.center,
  201. crossAxisAlignment: CrossAxisAlignment.center,
  202. children: <Widget>[
  203. /// Number
  204. Row(
  205. mainAxisAlignment: MainAxisAlignment.center,
  206. crossAxisAlignment: CrossAxisAlignment.center,
  207. children: <Widget>[
  208. /// nummber\
  209. Text(number,
  210. style: TextStyle(color: HexColor.fromHex(numberColor), fontSize: numberSize, fontWeight: FontWeight.bold, fontFamily: 'Din', package: 'zhiying_base_widget')),
  211. const SizedBox(width: 3),
  212. /// icon
  213. Visibility(visible: !EmptyUtil.isEmpty(icon), child: Container(height: 7, width: 5, color: Colors.red))
  214. ],
  215. ),
  216. /// Text
  217. Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: textSize))
  218. ],
  219. );
  220. }
  221. }