| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- //巡检任务列表
- import 'package:deus_app/common/style/TitleBar.dart';
- import 'package:flutter/material.dart';
- class PatrolJobPage extends StatefulWidget {
- const PatrolJobPage({super.key});
- static var routeName = '/PatrolJobPage';
- @override
- State createState() {
- return _PatrolJobPage();
- }
- }
- class _PatrolJobPage extends State<PatrolJobPage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: TitleBar().backAppbar(context, "巡检任务"),
- body: Column(
- children: [
- SizedBox(
- height: 1,
- ),
- Container(
- child: Text(
- '巡检任务来自于“巡检计划管理”,计划信息请登录pc端查看',
- style: TextStyle(fontSize: 14, color: Colors.white),
- ),
- height: 40,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: Colors.blueAccent, //背景色
- ),
- ),
- Expanded(
- child: Container(
- child: ListView.builder(
- itemCount: 20,
- itemBuilder: (context, index) {
- if (index != null) {
- return Container(
- margin: EdgeInsets.only(top: 12),
- color: Colors.white,
- child: ListTile(
- title: Column(
- children: [
- SizedBox(
- width: 50,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- padding: const EdgeInsets.all(10.0),
- alignment: Alignment.centerLeft,
- child: Text(
- '任务名称',
- style: TextStyle(fontSize: 18),
- ),
- ),
- Container(
- width: 100,
- height: 40,
- alignment: Alignment.center,
- child: Text(
- '已逾期',
- style: TextStyle(
- fontSize: 20, color: Colors.white),
- ),
- decoration: BoxDecoration(
- color: Colors.red, //背景色
- borderRadius:
- BorderRadius.all(Radius.circular(20.0)),
- ),
- )
- ],
- ),
- Container(
- padding: const EdgeInsets.all(10.0),
- alignment: Alignment.centerLeft,
- child: Text(
- '任务编号: $index',
- style: TextStyle(
- fontSize: 18,
- ),
- ),
- ),
- Container(
- padding: const EdgeInsets.all(10.0),
- alignment: Alignment.centerLeft,
- child: Text(
- '任务开始时间: $index',
- style: TextStyle(
- fontSize: 18,
- ),
- ),
- ),
- Container(
- padding: const EdgeInsets.all(10.0),
- alignment: Alignment.centerLeft,
- child: Text(
- '任务结束时间: $index',
- style: TextStyle(
- fontSize: 18,
- ),
- ),
- ),
- ],
- ),
- onTap: () {
- debugPrint("你点击了$index");
- },
- ));
- } else {
- return Container(
- margin: EdgeInsets.only(top: 12),
- color: Colors.white,
- child: ListTile(
- title: Column(
- children: [
- SizedBox(
- width: 50,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- padding: const EdgeInsets.all(10.0),
- alignment: Alignment.centerLeft,
- child: Text(
- '任务名称',
- style: TextStyle(fontSize: 18),
- ),
- ),
- Container(
- width: 100,
- height: 40,
- alignment: Alignment.center,
- child: Text(
- '进行中',
- style: TextStyle(
- fontSize: 20, color: Colors.white70),
- ),
- decoration: BoxDecoration(
- color: Colors.green, //背景色
- borderRadius:
- BorderRadius.all(Radius.circular(20.0)),
- ),
- )
- ],
- ),
- ],
- ),
- onTap: () {
- debugPrint("你点击了$index");
- },
- ));
- }
- },
- )))
- ],
- ));
- }
- }
|