notebook_item_widget.dart
3.73 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/notebook.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class NoteBookItem extends StatefulWidget {
final num index;
final Notebook notebook;
NoteBookItem(this.notebook,this.index);
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new NotebookItemState();
}
}
class NotebookItemState extends State<NoteBookItem>{
_onOperateClick(){
if(widget.notebook.operationText=="通知客户"){
NavigatorUtil.goInvicationPage(context, widget.notebook.id,widget.notebook.tableinfoStr,widget.notebook.ddate,widget.notebook.ddateStr);
}
}
@override
Widget build(BuildContext context) {
// TODO: implement build
Notebook notebook=widget.notebook;
Color textColor=(notebook.status=="3"||notebook.status=="4"||notebook.status=="6")?MyColours.color_bfbfbf:MyColours.color_353535;
return GestureDetector(
onTap: (){
NavigatorUtil.goNotebookDetailPage(context,notebook.id);
},
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(110),
color: (widget.index % 2 == 0) ? MyColours.color_f7fdfd : MyColours.color_ffffff,
child: Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(171),
alignment: Alignment.center,
child: Text(
notebook.tableinfoStr,
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
Container(
width: ScreenUtil().setWidth(230),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(notebook.rnameStr,style: TextStyle(color: textColor,fontSize: ScreenUtil().setSp(28)),),
VEmptyView(10),
Text(notebook.phoneStr,style: TextStyle(color: textColor,fontSize: ScreenUtil().setSp(22)),)
],
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
Container(
width: ScreenUtil().setWidth(159),
alignment: Alignment.center,
child: Text(
notebook.ddateStr,
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
GestureDetector(
onTap: _onOperateClick,
child: Container(
width: ScreenUtil().setWidth(184),
alignment: Alignment.center,
child: Text(
notebook.operationText,
style: TextStyle(
color: (notebook.status=="3"||notebook.status=="4"||notebook.status=="6")?MyColours.color_bfbfbf:MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(28)),
),
),
),
],
),
),
);
}
}