select_table_model.dart
1.5 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
// import 'package:flutter/material.dart';
// import 'package:one_key/constant/constant.dart';
// import 'package:one_key/constant/state.dart';
// import 'package:one_key/models/tableOuter.dart';
// import 'package:one_key/net/base_resp.dart';
// import 'package:one_key/net/dio_util.dart';
// import 'package:one_key/net/http_url.dart';
// import 'package:one_key/models/table.dart' as t;
// import 'package:one_key/utils/navigator_util.dart';
// import 'package:one_key/utils/utils.dart';
// class SelectTableModel {
// PageState pageState = PageState.Loading;
// //获取桌位数据
// Future<List<TableOuter>> getTableList(
// BuildContext context, Map<String, String> params,
// {isShowLoading = true}) async {
// if (isShowLoading) {
// pageState = PageState.Loading;
// notifyListeners();
// }
// BaseResp<List> baseResp = await DioUtil()
// .request<List>(context, Method.get, HttpUrl.table_list,
// data: params, showLoading: true)
// .catchError((error) {
// print(error.toString());
// });
// if (baseResp.code == Constant.status_success) {
// return (baseResp.data[0] as List).map((value) {
// TableOuter tableOuter = TableOuter();
// tableOuter.name = value["name"];
// tableOuter.list = (value["list"] as List).map((table) {
// return t.Table.fromJson(table as Map<String, dynamic>);
// }).toList();
// return tableOuter;
// }).toList();
// }
// return [];
// }
// }