patrol_job_page.dart 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. //巡检任务列表
  2. import 'package:deus_app/common/style/TitleBar.dart';
  3. import 'package:flutter/material.dart';
  4. class PatrolJobPage extends StatefulWidget {
  5. const PatrolJobPage({super.key});
  6. static var routeName = '/PatrolJobPage';
  7. @override
  8. State createState() {
  9. return _PatrolJobPage();
  10. }
  11. }
  12. class _PatrolJobPage extends State<PatrolJobPage> {
  13. @override
  14. Widget build(BuildContext context) {
  15. return Scaffold(
  16. appBar: TitleBar().backAppbar(context, "巡检任务"),
  17. body: Column(
  18. children: [
  19. SizedBox(
  20. height: 1,
  21. ),
  22. Container(
  23. child: Text(
  24. '巡检任务来自于“巡检计划管理”,计划信息请登录pc端查看',
  25. style: TextStyle(fontSize: 14, color: Colors.white),
  26. ),
  27. height: 40,
  28. alignment: Alignment.center,
  29. decoration: BoxDecoration(
  30. color: Colors.blueAccent, //背景色
  31. ),
  32. ),
  33. Expanded(
  34. child: Container(
  35. child: ListView.builder(
  36. itemCount: 20,
  37. itemBuilder: (context, index) {
  38. if (index != null) {
  39. return Container(
  40. margin: EdgeInsets.only(top: 12),
  41. color: Colors.white,
  42. child: ListTile(
  43. title: Column(
  44. children: [
  45. SizedBox(
  46. width: 50,
  47. ),
  48. Row(
  49. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  50. children: [
  51. Container(
  52. padding: const EdgeInsets.all(10.0),
  53. alignment: Alignment.centerLeft,
  54. child: Text(
  55. '任务名称',
  56. style: TextStyle(fontSize: 18),
  57. ),
  58. ),
  59. Container(
  60. width: 100,
  61. height: 40,
  62. alignment: Alignment.center,
  63. child: Text(
  64. '已逾期',
  65. style: TextStyle(
  66. fontSize: 20, color: Colors.white),
  67. ),
  68. decoration: BoxDecoration(
  69. color: Colors.red, //背景色
  70. borderRadius:
  71. BorderRadius.all(Radius.circular(20.0)),
  72. ),
  73. )
  74. ],
  75. ),
  76. Container(
  77. padding: const EdgeInsets.all(10.0),
  78. alignment: Alignment.centerLeft,
  79. child: Text(
  80. '任务编号: $index',
  81. style: TextStyle(
  82. fontSize: 18,
  83. ),
  84. ),
  85. ),
  86. Container(
  87. padding: const EdgeInsets.all(10.0),
  88. alignment: Alignment.centerLeft,
  89. child: Text(
  90. '任务开始时间: $index',
  91. style: TextStyle(
  92. fontSize: 18,
  93. ),
  94. ),
  95. ),
  96. Container(
  97. padding: const EdgeInsets.all(10.0),
  98. alignment: Alignment.centerLeft,
  99. child: Text(
  100. '任务结束时间: $index',
  101. style: TextStyle(
  102. fontSize: 18,
  103. ),
  104. ),
  105. ),
  106. ],
  107. ),
  108. onTap: () {
  109. debugPrint("你点击了$index");
  110. },
  111. ));
  112. } else {
  113. return Container(
  114. margin: EdgeInsets.only(top: 12),
  115. color: Colors.white,
  116. child: ListTile(
  117. title: Column(
  118. children: [
  119. SizedBox(
  120. width: 50,
  121. ),
  122. Row(
  123. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  124. children: [
  125. Container(
  126. padding: const EdgeInsets.all(10.0),
  127. alignment: Alignment.centerLeft,
  128. child: Text(
  129. '任务名称',
  130. style: TextStyle(fontSize: 18),
  131. ),
  132. ),
  133. Container(
  134. width: 100,
  135. height: 40,
  136. alignment: Alignment.center,
  137. child: Text(
  138. '进行中',
  139. style: TextStyle(
  140. fontSize: 20, color: Colors.white70),
  141. ),
  142. decoration: BoxDecoration(
  143. color: Colors.green, //背景色
  144. borderRadius:
  145. BorderRadius.all(Radius.circular(20.0)),
  146. ),
  147. )
  148. ],
  149. ),
  150. ],
  151. ),
  152. onTap: () {
  153. debugPrint("你点击了$index");
  154. },
  155. ));
  156. }
  157. },
  158. )))
  159. ],
  160. ));
  161. }
  162. }