device_manage_page.dart 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. import 'package:deus_app/common/style/TitleBar.dart';
  2. import 'package:deus_app/common/style/gsy_style.dart';
  3. import 'package:deus_app/common/utils/ConstantString.dart';
  4. import 'package:deus_app/widget/MyDrawer.dart';
  5. import 'package:flutter/material.dart';
  6. class DeviceManagePage extends StatefulWidget {
  7. static var routeName = '/DeviceManagePage';
  8. const DeviceManagePage({super.key});
  9. @override
  10. State createState() {
  11. return _DeviceManage();
  12. }
  13. }
  14. class _DeviceManage extends State<DeviceManagePage> {
  15. String deviceNum = "0";
  16. final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  17. @override
  18. Widget build(BuildContext contexts) {
  19. return Scaffold(
  20. key: _scaffoldKey,
  21. appBar: TitleBar().drawAppBar(ConstantString.deviceManageText, () {
  22. _scaffoldKey.currentState?.openEndDrawer();
  23. }),
  24. backgroundColor: const Color(0xfff2f2f2),
  25. endDrawer: MyDrawer(), //抽屉
  26. body: Column(
  27. children: [
  28. SizedBox(
  29. height: 10,
  30. ),
  31. Row(
  32. mainAxisAlignment:MainAxisAlignment.start,
  33. children: [
  34. SizedBox(
  35. width: 15,
  36. ),
  37. Text(ConstantString.deviceNum,
  38. style: GSYConstant.smallActionLightText),
  39. Text(deviceNum, style: GSYConstant.normalTextBigWhiteBold),
  40. ],
  41. ),
  42. Expanded(
  43. child: Container(
  44. child: ListView.builder(
  45. itemCount: 20,
  46. itemBuilder: (context, index) {
  47. return Container(
  48. margin: EdgeInsets.only(top: 12, left: 10, right: 10),
  49. padding: EdgeInsets.only(top: 12, bottom: 10),
  50. color: Colors.white,
  51. child: ListTile(
  52. title: Column(
  53. children: [
  54. Row(
  55. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  56. children: [
  57. Container(
  58. child: Text(
  59. '此处展示设备名称',
  60. style: TextStyle(
  61. color: Colors.black,
  62. fontSize: GSYConstant.middleTextWhiteSize,
  63. fontWeight: FontWeight.bold,
  64. ),
  65. ),
  66. ),
  67. Container(
  68. padding: EdgeInsets.only(
  69. top: 3, bottom: 3, left: 5, right: 5),
  70. child: Text(
  71. '运行中',
  72. textAlign: TextAlign.right,
  73. style: TextStyle(
  74. color: Colors.blue,
  75. fontSize: GSYConstant.minTextSize,
  76. ),
  77. ),
  78. decoration: BoxDecoration(
  79. border: new Border.all(
  80. color: Colors.blue, //边框颜色
  81. width: 1.0, //边框粗细
  82. ),
  83. borderRadius: const BorderRadius.all(
  84. const Radius.circular(3.0)), //边框的弧度
  85. ),
  86. )
  87. ]),
  88. SizedBox(
  89. height: 12,
  90. ),
  91. Row(
  92. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  93. children: [
  94. Container(
  95. child: Text(
  96. 'devicekey:',
  97. style: TextStyle(
  98. color: GSYColors.primaryLightValue,
  99. fontSize: GSYConstant.middleTextWhiteSize,
  100. ),
  101. ),
  102. ),
  103. Container(
  104. child: Text(
  105. 'devicekey',
  106. textAlign: TextAlign.right,
  107. style: TextStyle(
  108. color: GSYColors.primaryLightValue,
  109. fontSize: GSYConstant.middleTextWhiteSize,
  110. ),
  111. ),
  112. ),
  113. ]),
  114. SizedBox(
  115. height: 10,
  116. ),
  117. Row(
  118. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  119. children: [
  120. Container(
  121. child: Text(
  122. 'IMEI:',
  123. style: TextStyle(
  124. color: GSYColors.primaryLightValue,
  125. fontSize: GSYConstant.middleTextWhiteSize,
  126. ),
  127. ),
  128. ),
  129. Container(
  130. child: Text(
  131. 'IMEI',
  132. textAlign: TextAlign.right,
  133. style: TextStyle(
  134. color: GSYColors.primaryLightValue,
  135. fontSize: GSYConstant.middleTextWhiteSize,
  136. ),
  137. ),
  138. ),
  139. ]),
  140. SizedBox(
  141. height: 5,
  142. ),
  143. ],
  144. ),
  145. onTap: () {
  146. Scaffold.of(context).openEndDrawer();
  147. },
  148. ));
  149. },
  150. ),
  151. ))
  152. ],
  153. ),
  154. );
  155. }
  156. }