|
@@ -21,6 +21,7 @@ import 'package:one_key/widgets/app_bar.dart'; |
|
@@ -21,6 +21,7 @@ import 'package:one_key/widgets/app_bar.dart'; |
|
21
|
import 'package:one_key/widgets/area_item.dart';
|
21
|
import 'package:one_key/widgets/area_item.dart';
|
|
22
|
import 'package:one_key/widgets/common_button.dart';
|
22
|
import 'package:one_key/widgets/common_button.dart';
|
|
23
|
import 'package:one_key/widgets/common_button_flat.dart';
|
23
|
import 'package:one_key/widgets/common_button_flat.dart';
|
|
|
|
24
|
+import 'package:one_key/widgets/f_table_item.dart';
|
|
24
|
import 'package:one_key/widgets/h_empty_view.dart';
|
25
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
25
|
import 'package:one_key/widgets/page_exception.dart';
|
26
|
import 'package:one_key/widgets/page_exception.dart';
|
|
26
|
import 'package:one_key/widgets/system_app_bar.dart';
|
27
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
@@ -51,6 +52,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -51,6 +52,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
51
|
int _selectIndex = 0;
|
52
|
int _selectIndex = 0;
|
|
52
|
ScrollController _areaController = ScrollController();
|
53
|
ScrollController _areaController = ScrollController();
|
|
53
|
List<String> personNumList = [];
|
54
|
List<String> personNumList = [];
|
|
|
|
55
|
+ bool isSelected = true; //全部按钮
|
|
|
|
56
|
+
|
|
|
|
57
|
+ int _selectNumber;
|
|
54
|
|
58
|
|
|
55
|
final ItemPositionsListener itemPositionsListener =
|
59
|
final ItemPositionsListener itemPositionsListener =
|
|
56
|
ItemPositionsListener.create();
|
60
|
ItemPositionsListener.create();
|
|
@@ -59,13 +63,14 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -59,13 +63,14 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
59
|
void initState() {
|
63
|
void initState() {
|
|
60
|
// TODO: implement initState
|
64
|
// TODO: implement initState
|
|
61
|
super.initState();
|
65
|
super.initState();
|
|
|
|
66
|
+
|
|
62
|
LogUtil.v("table_manager_page initState");
|
67
|
LogUtil.v("table_manager_page initState");
|
|
63
|
for (int i = 1; i < 31; i++) {
|
68
|
for (int i = 1; i < 31; i++) {
|
|
64
|
personNumList.add(i.toString());
|
69
|
personNumList.add(i.toString());
|
|
65
|
}
|
70
|
}
|
|
66
|
|
71
|
|
|
67
|
// personNumList.add('30以上');
|
72
|
// personNumList.add('30以上');
|
|
68
|
- tableManagerModel = Provider.of<TableManagerModel>(context, listen: false);
|
73
|
+
|
|
69
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
74
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
70
|
tableManagerModel.initTime(context);
|
75
|
tableManagerModel.initTime(context);
|
|
71
|
EventBus().on("refresh_tablemanager", (arg) {
|
76
|
EventBus().on("refresh_tablemanager", (arg) {
|
|
@@ -121,225 +126,210 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -121,225 +126,210 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
121
|
|
126
|
|
|
122
|
/// Generate item number [i].
|
127
|
/// Generate item number [i].
|
|
123
|
Widget item(int i) {
|
128
|
Widget item(int i) {
|
|
124
|
- return SingleChildScrollView(
|
|
|
|
125
|
- child: Column(
|
|
|
|
126
|
- children: [
|
|
|
|
127
|
- VEmptyView(40),
|
|
|
|
128
|
- Container(
|
|
|
|
129
|
- alignment: Alignment.center,
|
|
|
|
130
|
- height: ScreenUtil().setWidth(21 * 2),
|
|
|
|
131
|
- child: Text(tableManagerModel.areas[i].name,
|
|
|
|
132
|
- style: TextStyle(
|
|
|
|
133
|
- fontSize: ScreenUtil().setWidth(30),
|
|
|
|
134
|
- color: MyColours.color_199095)),
|
|
|
|
135
|
- ),
|
|
|
|
136
|
- VEmptyView(30),
|
|
|
|
137
|
- GridView.builder(
|
|
|
|
138
|
- // controller: _areaController,
|
|
|
|
139
|
- physics: NeverScrollableScrollPhysics(),
|
|
|
|
140
|
- padding: EdgeInsets.only(top: 0),
|
|
|
|
141
|
- shrinkWrap: true,
|
|
|
|
142
|
- itemCount: tableManagerModel
|
|
|
|
143
|
- .areaTableMap[tableManagerModel.areas[i].name].length +
|
129
|
+ return GridView.builder(
|
|
|
|
130
|
+ // controller: _areaController,
|
|
|
|
131
|
+ // physics: NeverScrollableScrollPhysics(),
|
|
|
|
132
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
133
|
+ vertical: ScreenUtil().setWidth(20),
|
|
|
|
134
|
+ horizontal: ScreenUtil().setWidth(10)),
|
|
|
|
135
|
+ shrinkWrap: true,
|
|
|
|
136
|
+ itemCount: tableManagerModel.currentArea == '全部'
|
|
|
|
137
|
+ ? tableManagerModel.tablesShow.length
|
|
|
|
138
|
+ : tableManagerModel
|
|
|
|
139
|
+ .areaTableMapShow[tableManagerModel.areas[i].name].length +
|
|
144
|
1,
|
140
|
1,
|
|
145
|
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
146
|
- crossAxisCount: 4,
|
|
|
|
147
|
- childAspectRatio: 8 / 9,
|
|
|
|
148
|
- ),
|
|
|
|
149
|
- // mainAxisSpacing: ScreenUtil().setWidth(15 * 2),
|
|
|
|
150
|
- // crossAxisSpacing: ScreenUtil().setWidth(38 * 2)),
|
|
|
|
151
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
|
152
|
- if (index ==
|
|
|
|
153
|
- tableManagerModel
|
|
|
|
154
|
- .areaTableMap[tableManagerModel.areas[i].name].length ||
|
|
|
|
155
|
- tableManagerModel
|
|
|
|
156
|
- .areaTableMap[tableManagerModel.areas[i].name].length ==
|
|
|
|
157
|
- 0) {
|
|
|
|
158
|
- return InkWell(
|
|
|
|
159
|
- onTap: () async {
|
|
|
|
160
|
- List<String> areas = [];
|
|
|
|
161
|
- for (int i = 0; i < tableManagerModel.areas.length; i++) {
|
|
|
|
162
|
- areas.add(tableManagerModel.areas[i].name);
|
|
|
|
163
|
- }
|
141
|
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
142
|
+ crossAxisCount: 4,
|
|
|
|
143
|
+ childAspectRatio: 1,
|
|
|
|
144
|
+ mainAxisSpacing: ScreenUtil().setWidth(30),
|
|
|
|
145
|
+ crossAxisSpacing: ScreenUtil().setWidth(12),
|
|
|
|
146
|
+ ),
|
|
164
|
|
147
|
|
|
165
|
- //添加桌位弹框
|
|
|
|
166
|
- await DialogUtil.openCreateTableDialog(
|
|
|
|
167
|
- context, areas, i, personNumList,
|
|
|
|
168
|
- onTap: (Map<String, String> value) async {
|
|
|
|
169
|
- print(value);
|
|
|
|
170
|
- // 'areaname':
|
|
|
|
171
|
- // areas[currentAreaIndex],
|
|
|
|
172
|
- // 'name': controller.text,
|
|
|
|
173
|
- // 'pnumMin': pnumMin,
|
|
|
|
174
|
- // 'pnumMax': pnumMax
|
|
|
|
175
|
- //添加桌位 接口参数带整合???
|
|
|
|
176
|
- // 以下是旧的不去,明天添加桌位接口
|
|
|
|
177
|
- String rid;
|
|
|
|
178
|
- for (Area item in tableManagerModel.areas) {
|
|
|
|
179
|
- if (item.name == value['areaname']) {
|
|
|
|
180
|
- rid = item.rid;
|
|
|
|
181
|
- }
|
|
|
|
182
|
- }
|
|
|
|
183
|
- Map<String, String> params = {
|
|
|
|
184
|
- 'rid': rid,
|
|
|
|
185
|
- 'name': value['name'],
|
|
|
|
186
|
- };
|
|
|
|
187
|
- if (value['pnumMin'] != '') {
|
|
|
|
188
|
- params['pnum'] = value['pnumMin'];
|
|
|
|
189
|
- }
|
|
|
|
190
|
- if (value['pnumMax'] != '') {
|
|
|
|
191
|
- params['most_pnum'] = value['pnumMax'];
|
|
|
|
192
|
- }
|
|
|
|
193
|
- bool success =
|
|
|
|
194
|
- await tableManagerModel.addTable(context, params);
|
|
|
|
195
|
- print(success);
|
|
|
|
196
|
- if (success) {
|
|
|
|
197
|
- Utils.showToast('添加成功!');
|
|
|
|
198
|
- // TableOuter tableOuter = TableOuter();
|
|
|
|
199
|
- // tableOuter.name = value;
|
|
|
|
200
|
- // tableOuter.list = [];
|
|
|
|
201
|
- // tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
202
|
- // tableManagerModel.initData();
|
|
|
|
203
|
- // Timer(
|
|
|
|
204
|
- // Duration(milliseconds: 500),
|
|
|
|
205
|
- // () => _areaController.jumpTo(
|
|
|
|
206
|
- // _areaController.position.maxScrollExtent));
|
148
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
|
149
|
+ List<t.Table> data = tableManagerModel.currentArea == '全部'
|
|
|
|
150
|
+ ? tableManagerModel.tablesShow
|
|
|
|
151
|
+ : tableManagerModel
|
|
|
|
152
|
+ .areaTableMapShow[tableManagerModel.areas[i].name];
|
|
|
|
153
|
+ if (index == data.length || data.length == 0) {
|
|
|
|
154
|
+ return InkWell(
|
|
|
|
155
|
+ onTap: () async {
|
|
|
|
156
|
+ List<String> areas = [];
|
|
|
|
157
|
+ for (int i = 0; i < tableManagerModel.areas.length; i++) {
|
|
|
|
158
|
+ areas.add(tableManagerModel.areas[i].name);
|
|
|
|
159
|
+ }
|
|
207
|
|
160
|
|
|
208
|
- // await tableManagerModel
|
|
|
|
209
|
- // .getTableList(context);
|
|
|
|
210
|
- // await tableManagerModel
|
|
|
|
211
|
- // .initData();
|
|
|
|
212
|
- tableManagerModel.refreshTable(context);
|
|
|
|
213
|
- }
|
|
|
|
214
|
- });
|
|
|
|
215
|
- },
|
|
|
|
216
|
- child: Container(
|
|
|
|
217
|
- margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
|
|
|
|
218
|
- child: DottedBorder(
|
|
|
|
219
|
- dashPattern: [5, 5, 5, 5],
|
|
|
|
220
|
- borderType: BorderType.RRect,
|
|
|
|
221
|
- radius: Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
222
|
- // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
223
|
- color: MyColours.color_199095,
|
|
|
|
224
|
- strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
225
|
- child: ClipRRect(
|
|
|
|
226
|
- borderRadius: BorderRadius.all(
|
|
|
|
227
|
- Radius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
228
|
- child: Container(
|
|
|
|
229
|
- height: ScreenUtil().setWidth(90 * 2),
|
|
|
|
230
|
- width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
231
|
- child: Column(
|
|
|
|
232
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
233
|
- children: [
|
|
|
|
234
|
- Image.asset(Utils.getImgPath('add_area'),
|
|
|
|
235
|
- width: ScreenUtil().setWidth(32)),
|
|
|
|
236
|
- ],
|
|
|
|
237
|
- ),
|
|
|
|
238
|
- ),
|
|
|
|
239
|
- ),
|
|
|
|
240
|
- )));
|
|
|
|
241
|
- } else {
|
|
|
|
242
|
- return Selector<TableManagerModel, t.Table>(
|
|
|
|
243
|
- shouldRebuild: (pre, next) => true,
|
|
|
|
244
|
- selector: (context, model) => tableManagerModel
|
|
|
|
245
|
- .areaTableMap[tableManagerModel.areas[i].name][index],
|
|
|
|
246
|
- builder: (context, table, _) {
|
|
|
|
247
|
- return TableItem(table, onSelected: (table) {
|
|
|
|
248
|
- if ((table as t.Table).selected) {
|
|
|
|
249
|
- tableManagerModel.selectTables.add(table);
|
|
|
|
250
|
- } else {
|
|
|
|
251
|
- tableManagerModel.selectTables
|
|
|
|
252
|
- .removeWhere((t) => t.id == table.id);
|
161
|
+ //添加桌位弹框
|
|
|
|
162
|
+ await DialogUtil.openCreateTableDialog(
|
|
|
|
163
|
+ context, areas, i, personNumList,
|
|
|
|
164
|
+ onTap: (Map<String, String> value) async {
|
|
|
|
165
|
+ print(value);
|
|
|
|
166
|
+ // 'areaname':
|
|
|
|
167
|
+ // areas[currentAreaIndex],
|
|
|
|
168
|
+ // 'name': controller.text,
|
|
|
|
169
|
+ // 'pnumMin': pnumMin,
|
|
|
|
170
|
+ // 'pnumMax': pnumMax
|
|
|
|
171
|
+ //添加桌位 接口参数带整合???
|
|
|
|
172
|
+ // 以下是旧的不去,明天添加桌位接口
|
|
|
|
173
|
+ String rid;
|
|
|
|
174
|
+ for (Area item in tableManagerModel.areas) {
|
|
|
|
175
|
+ if (item.name == value['areaname']) {
|
|
|
|
176
|
+ rid = item.rid;
|
|
253
|
}
|
177
|
}
|
|
254
|
- DialogUtil.showTableManagerDialog(context, table)
|
|
|
|
255
|
- .then((value) {
|
|
|
|
256
|
- if (value != null) {
|
|
|
|
257
|
- switch (value) {
|
|
|
|
258
|
- case 1: //查看详情
|
|
|
|
259
|
- NavigatorUtil.goNotebookDetailPage(
|
|
|
|
260
|
- context,
|
|
|
|
261
|
- tableManagerModel.tableMap[table.id].id,
|
|
|
|
262
|
- tableManagerModel.tableMap[table.id].uid);
|
|
|
|
263
|
- break;
|
|
|
|
264
|
- case 2: //订座
|
|
|
|
265
|
- NavigatorUtil.goNoteBookChangePage(
|
|
|
|
266
|
- context,
|
|
|
|
267
|
- NotebookDetail.fromTableManager(
|
|
|
|
268
|
- tableManagerModel.getCurrDdateStr(),
|
|
|
|
269
|
- tableManagerModel.currTimeIndex.toString(),
|
|
|
|
270
|
- table),
|
|
|
|
271
|
- "");
|
|
|
|
272
|
- break;
|
178
|
+ }
|
|
|
|
179
|
+ Map<String, String> params = {
|
|
|
|
180
|
+ 'rid': rid,
|
|
|
|
181
|
+ 'name': value['name'],
|
|
|
|
182
|
+ };
|
|
|
|
183
|
+ if (value['pnumMin'] != '') {
|
|
|
|
184
|
+ params['pnum'] = value['pnumMin'];
|
|
|
|
185
|
+ }
|
|
|
|
186
|
+ if (value['pnumMax'] != '') {
|
|
|
|
187
|
+ params['most_pnum'] = value['pnumMax'];
|
|
|
|
188
|
+ }
|
|
|
|
189
|
+ bool success =
|
|
|
|
190
|
+ await tableManagerModel.addTable(context, params);
|
|
|
|
191
|
+ print(success);
|
|
|
|
192
|
+ if (success) {
|
|
|
|
193
|
+ Utils.showToast('添加成功!');
|
|
|
|
194
|
+ // TableOuter tableOuter = TableOuter();
|
|
|
|
195
|
+ // tableOuter.name = value;
|
|
|
|
196
|
+ // tableOuter.list = [];
|
|
|
|
197
|
+ // tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
198
|
+ // tableManagerModel.initData();
|
|
|
|
199
|
+ // Timer(
|
|
|
|
200
|
+ // Duration(milliseconds: 500),
|
|
|
|
201
|
+ // () => _areaController.jumpTo(
|
|
|
|
202
|
+ // _areaController.position.maxScrollExtent));
|
|
273
|
|
203
|
|
|
274
|
- case 3: //停用,启用桌位
|
|
|
|
275
|
- Map<String, String> params = {
|
|
|
|
276
|
- "id": (table as t.Table).id,
|
|
|
|
277
|
- "status":
|
|
|
|
278
|
- (table as t.Table).enable == "1" ? "0" : "1"
|
|
|
|
279
|
- };
|
|
|
|
280
|
- tableManagerModel
|
|
|
|
281
|
- .setSwitchStatus(context, params)
|
|
|
|
282
|
- .then((value) {
|
|
|
|
283
|
- if (value != null) {
|
|
|
|
284
|
- (table as t.Table).enable =
|
|
|
|
285
|
- ((int.parse((table as t.Table).enable) +
|
|
|
|
286
|
- 1) %
|
|
|
|
287
|
- 2)
|
|
|
|
288
|
- .toString();
|
|
|
|
289
|
- if ((table as t.Table).enable == "1") {
|
|
|
|
290
|
- for (Area area in tableManagerModel.areas) {
|
|
|
|
291
|
- if (area.name ==
|
|
|
|
292
|
- tableManagerModel.currentArea) {
|
|
|
|
293
|
- if (table.sign != '5' &&
|
|
|
|
294
|
- table.sign != '1') {
|
|
|
|
295
|
- //已预订
|
|
|
|
296
|
- area.count++;
|
|
|
|
297
|
- }
|
|
|
|
298
|
- break;
|
|
|
|
299
|
- }
|
204
|
+ // await tableManagerModel
|
|
|
|
205
|
+ // .getTableList(context);
|
|
|
|
206
|
+ // await tableManagerModel
|
|
|
|
207
|
+ // .initData();
|
|
|
|
208
|
+ tableManagerModel.refreshTable(context);
|
|
|
|
209
|
+ }
|
|
|
|
210
|
+ });
|
|
|
|
211
|
+ },
|
|
|
|
212
|
+ child: Container(
|
|
|
|
213
|
+ child: DottedBorder(
|
|
|
|
214
|
+ dashPattern: [5, 5, 5, 5],
|
|
|
|
215
|
+ borderType: BorderType.RRect,
|
|
|
|
216
|
+ radius: Radius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
217
|
+ // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
218
|
+ color: MyColours.color_E0E0E0,
|
|
|
|
219
|
+ strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
220
|
+ child: ClipRRect(
|
|
|
|
221
|
+ borderRadius: BorderRadius.all(
|
|
|
|
222
|
+ Radius.circular(ScreenUtil().setWidth(20))),
|
|
|
|
223
|
+ child: Container(
|
|
|
|
224
|
+ height: ScreenUtil.screenWidthDp -
|
|
|
|
225
|
+ ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
226
|
+ width: ScreenUtil.screenWidthDp -
|
|
|
|
227
|
+ ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
228
|
+ child: Column(
|
|
|
|
229
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
230
|
+ children: [
|
|
|
|
231
|
+ Image.asset(Utils.getImgPath('add_store'),
|
|
|
|
232
|
+ width: ScreenUtil().setWidth(32)),
|
|
|
|
233
|
+ ],
|
|
|
|
234
|
+ ),
|
|
|
|
235
|
+ ),
|
|
|
|
236
|
+ ),
|
|
|
|
237
|
+ )));
|
|
|
|
238
|
+ } else {
|
|
|
|
239
|
+ return Selector<TableManagerModel, t.Table>(
|
|
|
|
240
|
+ shouldRebuild: (pre, next) => true,
|
|
|
|
241
|
+ selector: (context, model) => data[index],
|
|
|
|
242
|
+ builder: (context, table, _) {
|
|
|
|
243
|
+ return FTableItem(table, onSelected: (table) {
|
|
|
|
244
|
+ if ((table as t.Table).selected) {
|
|
|
|
245
|
+ tableManagerModel.selectTables.add(table);
|
|
|
|
246
|
+ } else {
|
|
|
|
247
|
+ tableManagerModel.selectTables
|
|
|
|
248
|
+ .removeWhere((t) => t.id == table.id);
|
|
|
|
249
|
+ }
|
|
|
|
250
|
+ DialogUtil.showTableManagerDialog(context, table).then((value) {
|
|
|
|
251
|
+ if (value != null) {
|
|
|
|
252
|
+ switch (value) {
|
|
|
|
253
|
+ case 1: //查看详情
|
|
|
|
254
|
+ NavigatorUtil.goNotebookDetailPage(
|
|
|
|
255
|
+ context,
|
|
|
|
256
|
+ tableManagerModel.tableMap[table.id].id,
|
|
|
|
257
|
+ tableManagerModel.tableMap[table.id].uid);
|
|
|
|
258
|
+ break;
|
|
|
|
259
|
+ case 2: //订座
|
|
|
|
260
|
+ NavigatorUtil.goNoteBookChangePage(
|
|
|
|
261
|
+ context,
|
|
|
|
262
|
+ NotebookDetail.fromTableManager(
|
|
|
|
263
|
+ tableManagerModel.getCurrDdateStr(),
|
|
|
|
264
|
+ tableManagerModel.currTimeIndex.toString(),
|
|
|
|
265
|
+ table),
|
|
|
|
266
|
+ "");
|
|
|
|
267
|
+ break;
|
|
|
|
268
|
+
|
|
|
|
269
|
+ case 3: //停用,启用桌位
|
|
|
|
270
|
+ Map<String, String> params = {
|
|
|
|
271
|
+ "id": (table as t.Table).id,
|
|
|
|
272
|
+ "status": (table as t.Table).enable == "1" ? "0" : "1"
|
|
|
|
273
|
+ };
|
|
|
|
274
|
+ tableManagerModel
|
|
|
|
275
|
+ .setSwitchStatus(context, params)
|
|
|
|
276
|
+ .then((value) {
|
|
|
|
277
|
+ if (value != null) {
|
|
|
|
278
|
+ (table as t.Table).enable =
|
|
|
|
279
|
+ ((int.parse((table as t.Table).enable) + 1) % 2)
|
|
|
|
280
|
+ .toString();
|
|
|
|
281
|
+ if ((table as t.Table).enable == "1") {
|
|
|
|
282
|
+ for (Area area in tableManagerModel.areas) {
|
|
|
|
283
|
+ if (area.name ==
|
|
|
|
284
|
+ tableManagerModel.currentArea) {
|
|
|
|
285
|
+ if (table.sign != '5' && table.sign != '1') {
|
|
|
|
286
|
+ //已预订
|
|
|
|
287
|
+ area.count++;
|
|
300
|
}
|
288
|
}
|
|
301
|
- } else {
|
|
|
|
302
|
- for (Area area in tableManagerModel.areas) {
|
|
|
|
303
|
- if (area.name ==
|
|
|
|
304
|
- tableManagerModel.currentArea) {
|
|
|
|
305
|
- if (table.sign != '5' &&
|
|
|
|
306
|
- table.sign != '1') {
|
|
|
|
307
|
- //已预订
|
|
|
|
308
|
- area.count--;
|
|
|
|
309
|
- }
|
|
|
|
310
|
- break;
|
|
|
|
311
|
- }
|
289
|
+ break;
|
|
|
|
290
|
+ }
|
|
|
|
291
|
+ }
|
|
|
|
292
|
+ } else {
|
|
|
|
293
|
+ for (Area area in tableManagerModel.areas) {
|
|
|
|
294
|
+ if (area.name ==
|
|
|
|
295
|
+ tableManagerModel.currentArea) {
|
|
|
|
296
|
+ if (table.sign != '5' && table.sign != '1') {
|
|
|
|
297
|
+ //已预订
|
|
|
|
298
|
+ area.count--;
|
|
312
|
}
|
299
|
}
|
|
|
|
300
|
+ break;
|
|
313
|
}
|
301
|
}
|
|
314
|
- tableManagerModel.notifyListeners();
|
|
|
|
315
|
}
|
302
|
}
|
|
316
|
- });
|
|
|
|
317
|
- break;
|
|
|
|
318
|
- case 4: //照片管理
|
|
|
|
319
|
- NavigatorUtil.goTablePhotoManagerPage(context,
|
|
|
|
320
|
- tid: (table as t.Table).id,
|
|
|
|
321
|
- tname: (table as t.Table).name);
|
|
|
|
322
|
- break;
|
|
|
|
323
|
- }
|
|
|
|
324
|
- }
|
|
|
|
325
|
- });
|
|
|
|
326
|
- },
|
|
|
|
327
|
- canSelected: false,
|
|
|
|
328
|
- fromPage: 'table_manage',
|
|
|
|
329
|
- tableMap: tableManagerModel.tableMap,
|
|
|
|
330
|
- rid: "");
|
|
|
|
331
|
- },
|
|
|
|
332
|
- );
|
|
|
|
333
|
- }
|
|
|
|
334
|
- },
|
|
|
|
335
|
- ),
|
|
|
|
336
|
- ],
|
|
|
|
337
|
- ));
|
303
|
+ }
|
|
|
|
304
|
+ tableManagerModel.notifyListeners();
|
|
|
|
305
|
+ }
|
|
|
|
306
|
+ });
|
|
|
|
307
|
+ break;
|
|
|
|
308
|
+ case 4: //照片管理
|
|
|
|
309
|
+ NavigatorUtil.goTablePhotoManagerPage(context,
|
|
|
|
310
|
+ tid: (table as t.Table).id,
|
|
|
|
311
|
+ tname: (table as t.Table).name);
|
|
|
|
312
|
+ break;
|
|
|
|
313
|
+ }
|
|
|
|
314
|
+ }
|
|
|
|
315
|
+ });
|
|
|
|
316
|
+ },
|
|
|
|
317
|
+ canSelected: false,
|
|
|
|
318
|
+ fromPage: 'table_manage',
|
|
|
|
319
|
+ tableMap: tableManagerModel.tableMap,
|
|
|
|
320
|
+ rid: "");
|
|
|
|
321
|
+ },
|
|
|
|
322
|
+ );
|
|
|
|
323
|
+ }
|
|
|
|
324
|
+ },
|
|
|
|
325
|
+ );
|
|
338
|
}
|
326
|
}
|
|
339
|
|
327
|
|
|
340
|
@override
|
328
|
@override
|
|
341
|
Widget build(BuildContext context) {
|
329
|
Widget build(BuildContext context) {
|
|
|
|
330
|
+ tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
|
|
342
|
return Scaffold(
|
331
|
return Scaffold(
|
|
|
|
332
|
+ backgroundColor: MyColours.color_ffffff,
|
|
343
|
appBar: SystemAppBar("桌位", showLeading: false),
|
333
|
appBar: SystemAppBar("桌位", showLeading: false),
|
|
344
|
body: Consumer<TableManagerModel>(
|
334
|
body: Consumer<TableManagerModel>(
|
|
345
|
builder: (context, model, child) {
|
335
|
builder: (context, model, child) {
|
|
@@ -520,12 +510,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -520,12 +510,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
520
|
],
|
510
|
],
|
|
521
|
),
|
511
|
),
|
|
522
|
),
|
512
|
),
|
|
523
|
- VEmptyView(40),
|
|
|
|
524
|
- Consumer<TableManagerModel>(
|
|
|
|
525
|
- builder: (context, model, child) {
|
|
|
|
526
|
- if (model.pageState != PageState.Success) {
|
|
|
|
527
|
- return Expanded(
|
|
|
|
528
|
- child: ExceptionPage(
|
513
|
+ VEmptyView(30),
|
|
|
|
514
|
+
|
|
|
|
515
|
+ model.pageState != PageState.Success
|
|
|
|
516
|
+ ? Expanded(
|
|
|
|
517
|
+ child: ExceptionPage(
|
|
529
|
pageState: model.pageState,
|
518
|
pageState: model.pageState,
|
|
530
|
callback: () {
|
519
|
callback: () {
|
|
531
|
if (tableManagerModel.tableOuterList.isEmpty) {
|
520
|
if (tableManagerModel.tableOuterList.isEmpty) {
|
|
@@ -537,129 +526,293 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -537,129 +526,293 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
537
|
emptyMsg: "暂时没有桌位哦",
|
526
|
emptyMsg: "暂时没有桌位哦",
|
|
538
|
emptyImg: "empty_search",
|
527
|
emptyImg: "empty_search",
|
|
539
|
showMsg: "加载中,请稍后...",
|
528
|
showMsg: "加载中,请稍后...",
|
|
540
|
- ));
|
|
|
|
541
|
- } else {
|
|
|
|
542
|
- return Column(
|
|
|
|
543
|
- children: [
|
|
|
|
544
|
- Container(
|
|
|
|
545
|
- height: ScreenUtil().setWidth(100),
|
|
|
|
546
|
- child: Row(
|
|
|
|
547
|
- children: [
|
|
|
|
548
|
- Expanded(
|
|
|
|
549
|
- child: ListView.builder(
|
|
|
|
550
|
- itemCount: tableManagerModel.areas.length + 1,
|
|
|
|
551
|
- shrinkWrap: true,
|
|
|
|
552
|
- scrollDirection: Axis.horizontal,
|
|
|
|
553
|
- itemBuilder:
|
|
|
|
554
|
- (BuildContext contxt, int index) {
|
|
|
|
555
|
- if (index ==
|
|
|
|
556
|
- tableManagerModel.areas.length ||
|
|
|
|
557
|
- tableManagerModel.areas.length == 0) {
|
|
|
|
558
|
- return Column(
|
|
|
|
559
|
- children: [
|
|
|
|
560
|
- VEmptyView(20),
|
|
|
|
561
|
- DottedBorder(
|
|
|
|
562
|
- dashPattern: [5, 5, 5, 5],
|
|
|
|
563
|
- borderType: BorderType.RRect,
|
|
|
|
564
|
- radius: Radius.circular(
|
|
|
|
565
|
- ScreenUtil().setWidth(10)),
|
|
|
|
566
|
- // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
567
|
- color: MyColours.color_199095,
|
|
|
|
568
|
- strokeWidth:
|
|
|
|
569
|
- ScreenUtil().setWidth(2),
|
|
|
|
570
|
- child: ClipRRect(
|
|
|
|
571
|
- borderRadius: BorderRadius.all(
|
|
|
|
572
|
- Radius.circular(ScreenUtil()
|
|
|
|
573
|
- .setWidth(10))),
|
|
|
|
574
|
- child: Container(
|
|
|
|
575
|
- height: ScreenUtil()
|
|
|
|
576
|
- .setWidth(25 * 2),
|
|
|
|
577
|
- width: ScreenUtil()
|
|
|
|
578
|
- .setWidth(104 * 2),
|
|
|
|
579
|
- child: Column(
|
|
|
|
580
|
- mainAxisAlignment:
|
|
|
|
581
|
- MainAxisAlignment.center,
|
|
|
|
582
|
- children: [
|
|
|
|
583
|
- Image.asset(
|
|
|
|
584
|
- Utils.getImgPath(
|
|
|
|
585
|
- 'add_area'),
|
|
|
|
586
|
- width: ScreenUtil()
|
|
|
|
587
|
- .setWidth(24)),
|
|
|
|
588
|
- ],
|
529
|
+ ))
|
|
|
|
530
|
+ : Expanded(
|
|
|
|
531
|
+ child: Column(
|
|
|
|
532
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
533
|
+ children: [
|
|
|
|
534
|
+ Container(
|
|
|
|
535
|
+ color: MyColours.color_ffffff,
|
|
|
|
536
|
+ height: ScreenUtil().setWidth(90),
|
|
|
|
537
|
+ margin: EdgeInsets.only(
|
|
|
|
538
|
+ bottom: ScreenUtil().setWidth(30)),
|
|
|
|
539
|
+ child: Row(
|
|
|
|
540
|
+ children: [
|
|
|
|
541
|
+ HEmptyView(20),
|
|
|
|
542
|
+ Expanded(
|
|
|
|
543
|
+ child: ListView.builder(
|
|
|
|
544
|
+ itemCount: tableManagerModel.areas.length ==
|
|
|
|
545
|
+ 0
|
|
|
|
546
|
+ ? 1
|
|
|
|
547
|
+ : tableManagerModel.areas.length + 2,
|
|
|
|
548
|
+ shrinkWrap: true,
|
|
|
|
549
|
+ scrollDirection: Axis.horizontal,
|
|
|
|
550
|
+ itemBuilder:
|
|
|
|
551
|
+ (BuildContext contxt, int index) {
|
|
|
|
552
|
+ if (index ==
|
|
|
|
553
|
+ tableManagerModel.areas.length +
|
|
|
|
554
|
+ 1 ||
|
|
|
|
555
|
+ tableManagerModel.areas.length == 0) {
|
|
|
|
556
|
+ return InkWell(
|
|
|
|
557
|
+ onTap: () async {
|
|
|
|
558
|
+ //添加区域弹框
|
|
|
|
559
|
+ await DialogUtil
|
|
|
|
560
|
+ .openCreateAreaDialog(context,
|
|
|
|
561
|
+ onTap: (value) async {
|
|
|
|
562
|
+ print(value);
|
|
|
|
563
|
+ //添加区域
|
|
|
|
564
|
+ bool success =
|
|
|
|
565
|
+ await tableManagerModel
|
|
|
|
566
|
+ .addTableAreas(
|
|
|
|
567
|
+ context, value);
|
|
|
|
568
|
+ print(success);
|
|
|
|
569
|
+ if (success) {
|
|
|
|
570
|
+ Utils.showToast('添加成功!');
|
|
|
|
571
|
+
|
|
|
|
572
|
+ await tableManagerModel
|
|
|
|
573
|
+ .getTableList(context,
|
|
|
|
574
|
+ needLoading: false);
|
|
|
|
575
|
+ tableManagerModel.initData();
|
|
|
|
576
|
+
|
|
|
|
577
|
+ // setState(() {
|
|
|
|
578
|
+ // updateMenu();
|
|
|
|
579
|
+ // });
|
|
|
|
580
|
+ // _scrollToIndex(widget
|
|
|
|
581
|
+ // .tableManagerModel
|
|
|
|
582
|
+ // .areas
|
|
|
|
583
|
+ // .length);
|
|
|
|
584
|
+
|
|
|
|
585
|
+ }
|
|
|
|
586
|
+ });
|
|
|
|
587
|
+ },
|
|
|
|
588
|
+ child: Column(
|
|
|
|
589
|
+ children: [
|
|
|
|
590
|
+ VEmptyView(20),
|
|
|
|
591
|
+ DottedBorder(
|
|
|
|
592
|
+ dashPattern: [5, 5, 5, 5],
|
|
|
|
593
|
+ borderType: BorderType.RRect,
|
|
|
|
594
|
+ radius: Radius.circular(
|
|
|
|
595
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
596
|
+ // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
597
|
+ color: MyColours.color_199095,
|
|
|
|
598
|
+ strokeWidth:
|
|
|
|
599
|
+ ScreenUtil().setWidth(2),
|
|
|
|
600
|
+ child: ClipRRect(
|
|
|
|
601
|
+ borderRadius: BorderRadius
|
|
|
|
602
|
+ .all(Radius.circular(
|
|
|
|
603
|
+ ScreenUtil()
|
|
|
|
604
|
+ .setWidth(10))),
|
|
|
|
605
|
+ child: Container(
|
|
|
|
606
|
+ height: ScreenUtil()
|
|
|
|
607
|
+ .setWidth(25 * 2),
|
|
|
|
608
|
+ width: ScreenUtil()
|
|
|
|
609
|
+ .setWidth(104 * 2),
|
|
|
|
610
|
+ child: Column(
|
|
|
|
611
|
+ mainAxisAlignment:
|
|
|
|
612
|
+ MainAxisAlignment
|
|
|
|
613
|
+ .center,
|
|
|
|
614
|
+ children: [
|
|
|
|
615
|
+ Image.asset(
|
|
|
|
616
|
+ Utils.getImgPath(
|
|
|
|
617
|
+ 'add_area'),
|
|
|
|
618
|
+ width: ScreenUtil()
|
|
|
|
619
|
+ .setWidth(24)),
|
|
|
|
620
|
+ ],
|
|
|
|
621
|
+ ),
|
|
|
|
622
|
+ ),
|
|
589
|
),
|
623
|
),
|
|
|
|
624
|
+ )
|
|
|
|
625
|
+ ],
|
|
|
|
626
|
+ ),
|
|
|
|
627
|
+ );
|
|
|
|
628
|
+ } else {
|
|
|
|
629
|
+ if (index == 0) {
|
|
|
|
630
|
+ return InkWell(
|
|
|
|
631
|
+ onTap: () {
|
|
|
|
632
|
+ setState(() {
|
|
|
|
633
|
+ isSelected = true;
|
|
|
|
634
|
+ tableManagerModel.currentArea =
|
|
|
|
635
|
+ '全部';
|
|
|
|
636
|
+ tableManagerModel
|
|
|
|
637
|
+ .currentTables =
|
|
|
|
638
|
+ tableManagerModel
|
|
|
|
639
|
+ .areaTableMapShow[
|
|
|
|
640
|
+ tableManagerModel
|
|
|
|
641
|
+ .currentArea];
|
|
|
|
642
|
+ });
|
|
|
|
643
|
+ },
|
|
|
|
644
|
+ child: Container(
|
|
|
|
645
|
+ // width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
646
|
+ height: ScreenUtil().setWidth(80),
|
|
|
|
647
|
+ margin: EdgeInsets.only(
|
|
|
|
648
|
+ right:
|
|
|
|
649
|
+ ScreenUtil().setWidth(20),
|
|
|
|
650
|
+ top: ScreenUtil().setWidth(20),
|
|
|
|
651
|
+ ),
|
|
|
|
652
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
653
|
+ horizontal:
|
|
|
|
654
|
+ ScreenUtil().setWidth(20),
|
|
|
|
655
|
+ vertical: ScreenUtil()
|
|
|
|
656
|
+ .setWidth(10)),
|
|
|
|
657
|
+ alignment: Alignment.center,
|
|
|
|
658
|
+ decoration: BoxDecoration(
|
|
|
|
659
|
+ // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
660
|
+ color: isSelected
|
|
|
|
661
|
+ ? MyColours.color_199095
|
|
|
|
662
|
+ : MyColours.color_ffffff,
|
|
|
|
663
|
+ border: Border.all(
|
|
|
|
664
|
+ color: MyColours
|
|
|
|
665
|
+ .color_E0E0E0,
|
|
|
|
666
|
+ width: ScreenUtil()
|
|
|
|
667
|
+ .setWidth(2))),
|
|
|
|
668
|
+ child: Text(
|
|
|
|
669
|
+ '全部',
|
|
|
|
670
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
671
|
+ style: TextStyle(
|
|
|
|
672
|
+ color: isSelected
|
|
|
|
673
|
+ ? MyColours.color_ffffff
|
|
|
|
674
|
+ : MyColours
|
|
|
|
675
|
+ .color_333333,
|
|
|
|
676
|
+ fontSize:
|
|
|
|
677
|
+ ScreenUtil().setSp(28),
|
|
|
|
678
|
+ decoration:
|
|
|
|
679
|
+ TextDecoration.none,
|
|
|
|
680
|
+ fontWeight:
|
|
|
|
681
|
+ FontWeight.normal),
|
|
590
|
),
|
682
|
),
|
|
591
|
),
|
683
|
),
|
|
592
|
- )
|
|
|
|
593
|
- ],
|
|
|
|
594
|
- );
|
|
|
|
595
|
- } else {
|
|
|
|
596
|
- return AreaItemTable(
|
|
|
|
597
|
- model.areas[index],
|
|
|
|
598
|
- tableManagerModel.currentArea,
|
|
|
|
599
|
- (area) {});
|
|
|
|
600
|
- }
|
|
|
|
601
|
- },
|
|
|
|
602
|
- )),
|
|
|
|
603
|
- HEmptyView(40),
|
|
|
|
604
|
- MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
605
|
- ScreenUtil().setWidth(40),
|
|
|
|
606
|
- color: MyColours.color_F1F0F4),
|
|
|
|
607
|
- ],
|
684
|
+ );
|
|
|
|
685
|
+ } else {
|
|
|
|
686
|
+ return AreaItemTable(
|
|
|
|
687
|
+ model.areas[index - 1],
|
|
|
|
688
|
+ tableManagerModel.currentArea,
|
|
|
|
689
|
+ (area) {
|
|
|
|
690
|
+ setState(() {
|
|
|
|
691
|
+ isSelected = false;
|
|
|
|
692
|
+ _selectNumber = index - 1;
|
|
|
|
693
|
+ tableManagerModel.currentArea =
|
|
|
|
694
|
+ tableManagerModel
|
|
|
|
695
|
+ .areas[index - 1].name;
|
|
|
|
696
|
+ tableManagerModel.currentTables =
|
|
|
|
697
|
+ tableManagerModel
|
|
|
|
698
|
+ .areaTableMapShow[
|
|
|
|
699
|
+ tableManagerModel
|
|
|
|
700
|
+ .currentArea];
|
|
|
|
701
|
+ // _anmationMenu();
|
|
|
|
702
|
+ });
|
|
|
|
703
|
+ });
|
|
|
|
704
|
+ }
|
|
|
|
705
|
+ }
|
|
|
|
706
|
+ },
|
|
|
|
707
|
+ )),
|
|
|
|
708
|
+ InkWell(
|
|
|
|
709
|
+ onTap: () {
|
|
|
|
710
|
+ setState(() {
|
|
|
|
711
|
+ model.swichState = !model.swichState;
|
|
|
|
712
|
+ if (model.swichState) {
|
|
|
|
713
|
+ model.areaTableMapShow =
|
|
|
|
714
|
+ tableManagerModel
|
|
|
|
715
|
+ .areaTableMapCanNote;
|
|
|
|
716
|
+ model.tablesShow =
|
|
|
|
717
|
+ tableManagerModel.tablesCanNote;
|
|
|
|
718
|
+ } else {
|
|
|
|
719
|
+ model.areaTableMapShow =
|
|
|
|
720
|
+ model.areaTableMap;
|
|
|
|
721
|
+ model.tablesShow = model.tablesAll;
|
|
|
|
722
|
+ }
|
|
|
|
723
|
+ });
|
|
|
|
724
|
+ },
|
|
|
|
725
|
+ child: Container(
|
|
|
|
726
|
+ margin: EdgeInsets.only(
|
|
|
|
727
|
+ top: ScreenUtil().setWidth(20),
|
|
|
|
728
|
+ ),
|
|
|
|
729
|
+ child: Row(
|
|
|
|
730
|
+ children: [
|
|
|
|
731
|
+ MyDivider(ScreenUtil().setWidth(15),
|
|
|
|
732
|
+ ScreenUtil().setWidth(80),
|
|
|
|
733
|
+ color: MyColours.color_F1F0F4),
|
|
|
|
734
|
+ MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
735
|
+ ScreenUtil().setWidth(80),
|
|
|
|
736
|
+ color: MyColours.color_9C9C9C),
|
|
|
|
737
|
+ HEmptyView(30),
|
|
|
|
738
|
+ Image.asset(
|
|
|
|
739
|
+ model.swichState
|
|
|
|
740
|
+ ? Utils.getImgPath(
|
|
|
|
741
|
+ 'f_swich_on')
|
|
|
|
742
|
+ : Utils.getImgPath(
|
|
|
|
743
|
+ 'f_swich_off'),
|
|
|
|
744
|
+ width: ScreenUtil().setWidth(90),
|
|
|
|
745
|
+ // height: ScreenUtil().setWidth(82),
|
|
|
|
746
|
+ ),
|
|
|
|
747
|
+ HEmptyView(20),
|
|
|
|
748
|
+ Text(
|
|
|
|
749
|
+ '仅看\n空座',
|
|
|
|
750
|
+ style: TextStyle(
|
|
|
|
751
|
+ fontSize:
|
|
|
|
752
|
+ ScreenUtil().setSp(30),
|
|
|
|
753
|
+ color: MyColours.color_333333,
|
|
|
|
754
|
+ ),
|
|
|
|
755
|
+ ),
|
|
|
|
756
|
+ HEmptyView(40)
|
|
|
|
757
|
+ ],
|
|
|
|
758
|
+ )),
|
|
|
|
759
|
+ )
|
|
|
|
760
|
+ ],
|
|
|
|
761
|
+ ),
|
|
608
|
),
|
762
|
),
|
|
609
|
- )
|
|
|
|
610
|
- ],
|
|
|
|
611
|
- );
|
|
|
|
612
|
- // return CCMenuPage.builder(
|
|
|
|
613
|
- // tableManagerModel: tableManagerModel,
|
|
|
|
614
|
- // itemCount: tableManagerModel.areas.length,
|
|
|
|
615
|
- // onTap: (index) async {},
|
|
|
|
616
|
- // tabBuilder: (BuildContext context, int index) {
|
|
|
|
617
|
- // if (index == tableManagerModel.areas.length ||
|
|
|
|
618
|
- // tableManagerModel.areas.length == 0) {
|
|
|
|
619
|
- // return Column(
|
|
|
|
620
|
- // children: [
|
|
|
|
621
|
- // VEmptyView(20),
|
|
|
|
622
|
- // DottedBorder(
|
|
|
|
623
|
- // dashPattern: [5, 5, 5, 5],
|
|
|
|
624
|
- // borderType: BorderType.RRect,
|
|
|
|
625
|
- // radius:
|
|
|
|
626
|
- // Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
627
|
- // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
628
|
- // color: MyColours.color_199095,
|
|
|
|
629
|
- // strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
630
|
- // child: ClipRRect(
|
|
|
|
631
|
- // borderRadius: BorderRadius.all(
|
|
|
|
632
|
- // Radius.circular(
|
|
|
|
633
|
- // ScreenUtil().setWidth(10))),
|
|
|
|
634
|
- // child: Container(
|
|
|
|
635
|
- // height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
636
|
- // width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
637
|
- // child: Column(
|
|
|
|
638
|
- // mainAxisAlignment:
|
|
|
|
639
|
- // MainAxisAlignment.center,
|
|
|
|
640
|
- // children: [
|
|
|
|
641
|
- // Image.asset(
|
|
|
|
642
|
- // Utils.getImgPath('add_area'),
|
|
|
|
643
|
- // width: ScreenUtil().setWidth(24)),
|
|
|
|
644
|
- // ],
|
|
|
|
645
|
- // ),
|
|
|
|
646
|
- // ),
|
|
|
|
647
|
- // ),
|
|
|
|
648
|
- // )
|
|
|
|
649
|
- // ],
|
|
|
|
650
|
- // );
|
|
|
|
651
|
- // } else {
|
|
|
|
652
|
- // return AreaItemTable(model.areas[index],
|
|
|
|
653
|
- // tableManagerModel.currentArea, (area) {});
|
|
|
|
654
|
- // }
|
|
|
|
655
|
- // },
|
|
|
|
656
|
- // itemBuilder: (BuildContext context, int index) {
|
|
|
|
657
|
- // return item(index);
|
|
|
|
658
|
- // },
|
|
|
|
659
|
- // );
|
|
|
|
660
|
- }
|
|
|
|
661
|
- },
|
|
|
|
662
|
- ),
|
763
|
+ Expanded(
|
|
|
|
764
|
+ child: Container(
|
|
|
|
765
|
+ color: Color.fromRGBO(249, 249, 249, 1),
|
|
|
|
766
|
+ child: item(_selectNumber))),
|
|
|
|
767
|
+ ]))
|
|
|
|
768
|
+ // return CCMenuPage.builder(
|
|
|
|
769
|
+ // tableManagerModel: tableManagerModel,
|
|
|
|
770
|
+ // itemCount: tableManagerModel.areas.length,
|
|
|
|
771
|
+ // onTap: (index) async {},
|
|
|
|
772
|
+ // tabBuilder: (BuildContext context, int index) {
|
|
|
|
773
|
+ // if (index == tableManagerModel.areas.length ||
|
|
|
|
774
|
+ // tableManagerModel.areas.length == 0) {
|
|
|
|
775
|
+ // return Column(
|
|
|
|
776
|
+ // children: [
|
|
|
|
777
|
+ // VEmptyView(20),
|
|
|
|
778
|
+ // DottedBorder(
|
|
|
|
779
|
+ // dashPattern: [5, 5, 5, 5],
|
|
|
|
780
|
+ // borderType: BorderType.RRect,
|
|
|
|
781
|
+ // radius:
|
|
|
|
782
|
+ // Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
783
|
+ // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
784
|
+ // color: MyColours.color_199095,
|
|
|
|
785
|
+ // strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
786
|
+ // child: ClipRRect(
|
|
|
|
787
|
+ // borderRadius: BorderRadius.all(
|
|
|
|
788
|
+ // Radius.circular(
|
|
|
|
789
|
+ // ScreenUtil().setWidth(10))),
|
|
|
|
790
|
+ // child: Container(
|
|
|
|
791
|
+ // height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
792
|
+ // width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
793
|
+ // child: Column(
|
|
|
|
794
|
+ // mainAxisAlignment:
|
|
|
|
795
|
+ // MainAxisAlignment.center,
|
|
|
|
796
|
+ // children: [
|
|
|
|
797
|
+ // Image.asset(
|
|
|
|
798
|
+ // Utils.getImgPath('add_area'),
|
|
|
|
799
|
+ // width: ScreenUtil().setWidth(24)),
|
|
|
|
800
|
+ // ],
|
|
|
|
801
|
+ // ),
|
|
|
|
802
|
+ // ),
|
|
|
|
803
|
+ // ),
|
|
|
|
804
|
+ // )
|
|
|
|
805
|
+ // ],
|
|
|
|
806
|
+ // );
|
|
|
|
807
|
+ // } else {
|
|
|
|
808
|
+ // return AreaItemTable(model.areas[index],
|
|
|
|
809
|
+ // tableManagerModel.currentArea, (area) {});
|
|
|
|
810
|
+ // }
|
|
|
|
811
|
+ // },
|
|
|
|
812
|
+ // itemBuilder: (BuildContext context, int index) {
|
|
|
|
813
|
+ // return item(index);
|
|
|
|
814
|
+ // },
|
|
|
|
815
|
+ // );
|
|
663
|
],
|
816
|
],
|
|
664
|
);
|
817
|
);
|
|
665
|
},
|
818
|
},
|