verify_food_page.dart
8.8 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
import 'package:flutter/material.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import '../../res/colors.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/h_empty_view.dart';
import '../../widgets/round_button.dart';
import '../../widgets/v_empty_view.dart';
/**
* 核餐页面
* */
class VerifyFoodPage extends StatefulWidget {
VerifyFoodPage({Key key}) : super(key: key);
@override
_VerifyFoodPageState createState() => _VerifyFoodPageState();
}
class _VerifyFoodPageState extends State<VerifyFoodPage> {
bool confirmed = true; //已确认
bool connected = false; //未接通
bool undetermined = false; //待定
TextEditingController customController = TextEditingController();
FocusNode _cusdemNode = FocusNode();
_itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Row(children: [
Image.asset(
Utils.getImgPath(
select ? 'plan_dish_select' : 'plan_dish_unselect'),
width: w(20),
),
HEmptyView(6),
Text(
title,
style: TextStyle(color: MyColours.color_515151, fontSize: font(16)),
),
]));
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('核餐确认'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(24)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
_itemRadioWidget(confirmed, '已确认', onTap: () {
if (!confirmed) {
setState(() {
confirmed = true;
connected = false;
undetermined = false;
});
}
}),
Spacer(),
_itemRadioWidget(connected, '未接通', onTap: () {
if (!connected) {
setState(() {
connected = true;
confirmed = false;
undetermined = false;
});
}
}),
Spacer(),
_itemRadioWidget(undetermined, '待定', onTap: () {
if (!undetermined) {
setState(() {
undetermined = true;
connected = false;
confirmed = false;
});
}
}),
],
),
VEmptyView(40),
Text(
'备注',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(15)),
),
VEmptyView(30),
//输入框
Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
color: MyColours.color_DBDBDB, width: w(1)),
borderRadius: BorderRadius.circular(r(8))),
child: TextField(
controller: customController,
focusNode: _cusdemNode,
style: TextStyle(
color: MyColours.color_333333,
fontSize: font(14),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 100,
decoration: InputDecoration(
hintText: "请输入备注或点击快捷选择标签",
hintStyle: TextStyle(
color: MyColours.color_979797,
fontSize: font(14),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
// setState(() {
// currentRemark = value ?? "";
// });
// if (value.length < currRemark.length &&
// currRemark.substring(value.length) != ',') {
// setState(() {
// currRemark = value ?? "";
// });
// if (sum == 0) {
// for (int i = 0; i < remarks.length; i++) {
// if (remarks[i].isSelect &&
// remarks[i].remark == selectItem.last) {
// setState(() {
// remarks[i].isSelect = false;
// });
// }
// }
// }
// sum++;
// if (sum == selectItem.last.length ||
// selectItem.length == 1 ||
// selectItem.length == 0) {
// selectItem.removeLast();
// sum = 0;
// }
// } else {
// setState(() {
// currRemark = value ?? "";
// });
// }
}),
),
VEmptyView(20),
MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_BFC4D4,
),
VEmptyView(30),
Container(
margin: EdgeInsets.only(bottom: w(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'未接通、已确认、待定',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)),
),
Text(
'张小娴 2023-12-16 15:23',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14)),
),
]))
],
),
))),
Container(
padding: EdgeInsets.symmetric(horizontal: w(24), vertical: w(35)),
child: Row(
children: [
RoundButton(
text: '取消',
width: w(100),
height: w(43),
radius: r(5),
fontSize: 32,
isBold: true,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
onPressed: () {
Navigator.pop(context);
},
),
HEmptyView(24),
Expanded(
child: RoundButton(
text: '保存',
height: w(43),
radius: r(5),
isBold: true,
fontSize: 32,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: () {
// _setBanquetDeposit();
},
)),
],
),
)
],
),
);
}
}