personnel_manage_view.dart
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../common/colors.dart';
import 'personnel_manage_logic.dart';
class Personnel_managePage extends GetView<Personnel_manageLogic> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('人员管理'),
centerTitle: true,
backgroundColor: ColorConfig.themeColor,
),
body: GetBuilder<Personnel_manageLogic>(builder: (logic){
return Column(
children: [
InkWell(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 20),
padding: EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(
color: ColorConfig.themeColor,
borderRadius: BorderRadius.all(Radius.circular(5))
),
child: Text('添加人员', style: TextStyle(color: ColorConfig.white, fontSize: 15),),
),
onTap: () { controller.addPerson(); },
),
Expanded(
child: ListView.builder(
itemBuilder: (context, index) {
return Container(
alignment: Alignment.centerLeft,
color: index %2 == 0 ? ColorConfig.white : ColorConfig.colorF2F2F2,
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('人员${index+1} | 女', style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),),
Text('身份证: 123456789',),
Text('电话: 123456789',),
Text('家庭住址: xxxxxxx',),
],
)
),
InkWell(
child: Container(
width: 54,
height: 30,
color: ColorConfig.themeColor,
alignment: Alignment.center,
child: Text('编辑', style: TextStyle(color: ColorConfig.white),),
),
onTap: () { controller.editPerson(index); },
),
const SizedBox(width: 10,),
InkWell(
child: Container(
width: 54,
height: 30,
color: ColorConfig.color548DEE,
alignment: Alignment.center,
child: Text('删除', style: TextStyle(color: ColorConfig.white),),
),
onTap: () {
controller.deletePerson(index);
},
),
],
),
);
},
itemCount: controller.data_list.length,
)
)
],
);
},)
);
}
}