基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

123 lines
4.3 KiB

  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. ///
  4. /// 我的团队 - 数据widget
  5. ///
  6. class TeamDataWidget extends StatelessWidget {
  7. @override
  8. Widget build(BuildContext context) {
  9. return Material(
  10. child: _getMainWidget(),
  11. );
  12. }
  13. /// 主视图
  14. Widget _getMainWidget() {
  15. return Container(
  16. width: double.infinity,
  17. margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8),
  18. padding: const EdgeInsets.only(left: 10.5, right: 9.5, top: 8, bottom: 8),
  19. decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor.fromHex('#FFFFFF')),
  20. child: Column(
  21. mainAxisAlignment: MainAxisAlignment.center,
  22. crossAxisAlignment: CrossAxisAlignment.center,
  23. children: <Widget>[
  24. /// 直推人数 & 间推人数
  25. Row(
  26. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  27. crossAxisAlignment: CrossAxisAlignment.end,
  28. children: <Widget>[
  29. /// 直推人数
  30. _getCustomWidget(text: '直推人数', textColor: '#999999', textSize: 12, number: '2258', numberColor: '#333333', numberSize: 30, icon: 'sss'),
  31. /// 分割线
  32. // VerticalDivider(width: 0.5, thickness: 40, color: HexColor.fromHex('#F0F0F0')),
  33. SizedBox(height: 40, child: VerticalDivider(thickness: 0.5, color: HexColor.fromHex('#F0F0F0'), width: 0.5, )),
  34. /// 间推人数
  35. _getCustomWidget(text: '间推人数', textColor: '#999999', textSize: 12, number: '469', numberColor: '#333333', numberSize: 30, icon: 'sss'),
  36. ],
  37. ),
  38. /// 分割线
  39. Divider(thickness: 0.5, height: 20, color: HexColor.fromHex('#F0F0F0')),
  40. /// 全部粉丝 & 今日新增 & 昨日新增
  41. Row(
  42. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  43. children: <Widget>[
  44. /// 全部粉丝
  45. _getCustomWidget(
  46. text: '全部粉丝',
  47. textColor: '#999999',
  48. textSize: 11,
  49. number: '2258',
  50. numberColor: '#333333',
  51. numberSize: 15,
  52. ),
  53. /// 分割线
  54. // VerticalDivider(thickness: 0.5, width: 1, color: HexColor.fromHex('#F0F0F0')),
  55. SizedBox(height: 35, child: VerticalDivider(thickness: 0.5, color: HexColor.fromHex('#F0F0F0'), width: 0.5, )),
  56. /// 今日新增
  57. _getCustomWidget(
  58. text: '今日新增',
  59. textColor: '#999999',
  60. textSize: 11,
  61. number: '4',
  62. numberColor: '#333333',
  63. numberSize: 15,
  64. ),
  65. /// 分割线
  66. // VerticalDivider(thickness: 0.5, width: 1, color: HexColor.fromHex('#F0F0F0')),
  67. SizedBox(height: 35, child: VerticalDivider(thickness: 0.5, color: HexColor.fromHex('#F0F0F0'), width: 0.5, )),
  68. /// 昨日新增
  69. _getCustomWidget(
  70. text: '昨日新增',
  71. textColor: '#999999',
  72. textSize: 11,
  73. number: '12',
  74. numberColor: '#333333',
  75. numberSize: 15,
  76. ),
  77. ],
  78. )
  79. ],
  80. ),
  81. );
  82. }
  83. /// 自定义Widget
  84. Widget _getCustomWidget({String text, String textColor, double textSize, String number, String numberColor, double numberSize, String icon}) {
  85. return Column(
  86. mainAxisAlignment: MainAxisAlignment.center,
  87. crossAxisAlignment: CrossAxisAlignment.center,
  88. children: <Widget>[
  89. /// Number
  90. Row(
  91. crossAxisAlignment: CrossAxisAlignment.center,
  92. mainAxisAlignment: MainAxisAlignment.center,
  93. children: <Widget>[
  94. /// nummber\
  95. Text(number,
  96. style: TextStyle(color: HexColor.fromHex(numberColor), fontSize: numberSize, fontWeight: FontWeight.bold, fontFamily: 'Din', package: 'zhiying_base_widget')),
  97. const SizedBox(width: 3),
  98. /// icon
  99. Visibility(visible: !EmptyUtil.isEmpty(icon), child: Container(height: 7, width: 5, color: Colors.red))
  100. ],
  101. ),
  102. /// Text
  103. Text(text, style: TextStyle(color: HexColor.fromHex(textColor), fontSize: textSize))
  104. ],
  105. );
  106. }
  107. }