基础组件库
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

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