body_screen.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_svg/svg.dart';
  3. import 'package:empty/constants.dart';
  4. import 'package:empty/components/grid_list.dart';
  5. class BodyScreen extends StatefulWidget {
  6. @override
  7. _BodyScreenState createState() => _BodyScreenState();
  8. }
  9. class _BodyScreenState extends State<BodyScreen> {
  10. @override
  11. void initState() {
  12. // TODO: implement initState
  13. super.initState();
  14. panelController.close();
  15. if (!isPlaying) panelController.hide();
  16. }
  17. @override
  18. Widget build(BuildContext context) {
  19. return DefaultTabController(
  20. length: 4,
  21. child: Column(
  22. children: [
  23. Container(
  24. color: Color.fromRGBO(0, 41, 91, 0.8),
  25. constraints: BoxConstraints.expand(height: 50.0),
  26. child: TabBar(
  27. indicatorSize: TabBarIndicatorSize.tab,
  28. // isScrollable: true,
  29. tabs: [
  30. Tab(
  31. child: Row(
  32. children: [
  33. SvgPicture.asset(
  34. 'assets/icons/sbtn_walk.svg',
  35. width: 20,
  36. height: 20,
  37. ),
  38. SizedBox(
  39. width: 10,
  40. ),
  41. Text('Walk')
  42. ],
  43. ),
  44. ),
  45. Tab(
  46. child: Row(
  47. children: [
  48. SvgPicture.asset(
  49. 'assets/icons/sbtn_Stand.svg',
  50. width: 20,
  51. height: 20,
  52. ),
  53. SizedBox(
  54. width: 10,
  55. ),
  56. Text('Stay')
  57. ],
  58. ),
  59. ),
  60. Tab(
  61. child: Row(
  62. children: [
  63. SvgPicture.asset(
  64. 'assets/icons/sbtn_Sit.svg',
  65. width: 20,
  66. height: 20,
  67. ),
  68. SizedBox(
  69. width: 10,
  70. ),
  71. Text('Sit')
  72. ],
  73. ),
  74. ),
  75. Tab(
  76. child: Row(
  77. children: [
  78. SvgPicture.asset(
  79. 'assets/icons/sbtn_Lying.svg',
  80. width: 20,
  81. height: 20,
  82. ),
  83. SizedBox(
  84. width: 10,
  85. ),
  86. Text('Lying')
  87. ],
  88. ),
  89. ),
  90. ],
  91. ),
  92. ),
  93. Expanded(
  94. child: Container(
  95. child: TabBarView(children: [
  96. GridListView(
  97. type: 'body', section: 'walk', rcmd: '', page: 1, size: 10),
  98. GridListView(
  99. type: 'body', section: 'stay', rcmd: '', page: 1, size: 10),
  100. GridListView(
  101. type: 'body', section: 'sit', rcmd: '', page: 1, size: 10),
  102. GridListView(
  103. type: 'body', section: 'lying', rcmd: '', page: 1, size: 10),
  104. ]),
  105. ))
  106. ],
  107. ),
  108. );
  109. }
  110. }