patrol_job_page.dart 6.7 KB

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