notebook_item_widget.dart
5.21 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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 Container(
width: double.infinity,
height: ScreenUtil().setWidth(120),
color: (widget.index % 2 == 0)
? MyColours.color_f7fdfd
: MyColours.color_ffffff,
child: Row(
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
NavigatorUtil.goNotebookDetailPage(context, notebook.id);
},
child: Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(171),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
alignment: Alignment.center,
child: Text(
notebook.tableinfoStr?.trim(),
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
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,
// 'nnnnnnnnnnnnnn',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
VEmptyView(10),
Text(
notebook.phoneStr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(26)),
)
],
),
),
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,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
],
),
),
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,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
),
],
),
);
}
}