基础组件库
 
 
 
 
 

111 lines
3.5 KiB

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