device_manage_page.dart 6.6 KB

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