Commit 43305ba9be44cb8eaf71249771a07ae692f83f43

Authored by wdn127929
1 parent 47f54a42

添加桌位OK

///桌位区域
class Area{
class Area {
String name;
int count;
String rid;
Area();
factory Area.fromJson(Map<String,dynamic> json)=>Area()..name=json["name"]..count=json["count"];
factory Area.fromJson(Map<String, dynamic> json) => Area()
..name = json["name"]
..count = json["count"];
Map<String,dynamic> toJson()=><String,dynamic>{"name":name,"count":count};
}
\ No newline at end of file
Map<String, dynamic> toJson() =>
<String, dynamic>{"name": name, "count": count};
}
... ...
import 'package:one_key/models/table.dart';
class TableOuter{
class TableOuter {
String name;
List<Table> list;
String rid;
TableOuter();
factory TableOuter.fromJson(Map<String,dynamic> json)=>TableOuter()..name=json["name"]..list=json["list"] ;
factory TableOuter.fromJson(Map<String, dynamic> json) => TableOuter()
..name = json["name"]
..list = json["list"];
Map<String,dynamic> toJson()=>{"name":name,"list":list};
Map<String, dynamic> toJson() => {"name": name, "list": list};
@override
String toString() {
return 'TableOuter{name: $name, list: $list}';
}
}
\ No newline at end of file
}
... ...
... ... @@ -180,7 +180,7 @@ class DioUtil {
bool connectivity = await Utils.checkConnectiviy();
if (!connectivity) {
Utils.showToast("网络错误,请稍后重试");
throw MyError(type: 1);
throw MyError(type: 1);
}
if (showLoading) Loading.showLoading(context);
try {
... ...
... ... @@ -105,5 +105,6 @@ class HttpUrl {
"?service=App.Tables.AddTableRegion"; // 添加商家桌位区域
static const String get_area_by_sellerid =
"?service=App.Tables.GetRegionBySellerid"; // 获取区域列表
static const String add_table = "?service=App.Tables.AddTable"; // 添加商家桌位信息
}
... ...
... ... @@ -46,6 +46,7 @@ class TableManagerPageState extends State<TableManagerPage> {
int max;
int _selectIndex;
ScrollController _areaController = ScrollController();
List<String> personNumList = [];
final ItemPositionsListener itemPositionsListener =
ItemPositionsListener.create();
... ... @@ -55,6 +56,10 @@ class TableManagerPageState extends State<TableManagerPage> {
// TODO: implement initState
super.initState();
LogUtil.v("table_manager_page initState");
for (int i = 1; i < 31; i++) {
personNumList.add(i.toString());
}
// personNumList.add('30以上');
tableManagerModel = Provider.of<TableManagerModel>(context, listen: false);
WidgetsBinding.instance.addPostFrameCallback((_) {
tableManagerModel.initTime(context);
... ... @@ -134,30 +139,52 @@ class TableManagerPageState extends State<TableManagerPage> {
//添加桌位弹框
await DialogUtil.openCreateTableDialog(
context, areas, i, ['1', '2', '3'],
onTap: (value) async {
context, areas, i, personNumList,
onTap: (Map<String, String> value) async {
print(value);
// 'areaname':
// areas[currentAreaIndex],
// 'name': controller.text,
// 'pnumMin': pnumMin,
// 'pnumMax': pnumMax
//添加桌位 接口参数带整合???
// 以下是旧的不去,明天添加桌位接口
String rid;
for (Area item in tableManagerModel.areas) {
if (item.name == value['areaname']) {
rid = item.rid;
}
}
Map<String, String> params = {
'rid': rid,
'name': value['name'],
};
if (value['pnumMin'] != '') {
params['pnum'] = value['pnumMin'];
}
if (value['pnumMax'] != '') {
params['most_pnum'] = value['pnumMax'];
}
bool success =
await tableManagerModel.addTableAreas(context, value);
await tableManagerModel.addTable(context, params);
print(success);
if (success) {
Utils.showToast('添加成功!');
TableOuter tableOuter = TableOuter();
tableOuter.name = value;
tableOuter.list = [];
tableManagerModel.tableOuterList.add(tableOuter);
tableManagerModel.initData();
Timer(
Duration(milliseconds: 500),
() => _areaController.jumpTo(
_areaController.position.maxScrollExtent));
// TableOuter tableOuter = TableOuter();
// tableOuter.name = value;
// tableOuter.list = [];
// tableManagerModel.tableOuterList.add(tableOuter);
// tableManagerModel.initData();
// Timer(
// Duration(milliseconds: 500),
// () => _areaController.jumpTo(
// _areaController.position.maxScrollExtent));
// await tableManagerModel
// .getTableList(context);
// await tableManagerModel
// .initData();
tableManagerModel.refreshTable(context);
}
});
},
... ... @@ -498,12 +525,15 @@ class TableManagerPageState extends State<TableManagerPage> {
print(success);
if (success) {
Utils.showToast('添加成功!');
TableOuter tableOuter =
TableOuter();
tableOuter.name = value;
tableOuter.list = [];
tableManagerModel.tableOuterList
.add(tableOuter);
// TableOuter tableOuter =
// TableOuter();
// tableOuter.name = value;
// tableOuter.list = [];
// tableManagerModel.tableOuterList
// .add(tableOuter);
await tableManagerModel
.getTableList(context,
needLoading: false);
tableManagerModel.initData();
Timer(
Duration(milliseconds: 500),
... ...
... ... @@ -231,9 +231,13 @@ class TableManagerModel with ChangeNotifier {
}
//获取桌位数据
Future<List<TableOuter>> getTableList(BuildContext context) async {
pageState = PageState.Loading;
notifyListeners();
Future<List<TableOuter>> getTableList(BuildContext context,
{bool needLoading = true}) async {
if (needLoading) {
pageState = PageState.Loading;
notifyListeners();
}
Map<String, String> params = {"sellerid": userModel.user.sellerid};
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.table_list,
... ... @@ -276,23 +280,31 @@ class TableManagerModel with ChangeNotifier {
}).toList();
}
List<AreaSunModel> areaSunModelList = await getRegionBySellerid(context);
List<String> tempTableName = [];
List<String> tempAreaName = [];
for (TableOuter itemTable in tableOuterList) {
tempTableName.add(itemTable.name);
}
for (AreaSunModel itemArea in areaSunModelList) {
tempAreaName.add(itemArea.name);
}
if (tempAreaName.length > tempTableName.length) {
for (var itemT in tempTableName) {
tempAreaName.removeWhere((element) => element == itemT);
if (areaSunModelList != null && areaSunModelList.length > 0) {
List<String> tempTableName = []; //有桌子区域
List<String> tempAreaName = []; //全部区域
for (TableOuter itemTable in tableOuterList) {
tempTableName.add(itemTable.name);
}
for (var item in tempAreaName) {
TableOuter tableOuter = TableOuter();
tableOuter.name = item;
tableOuter.list = [];
tableOuterList.add(tableOuter);
for (AreaSunModel itemArea in areaSunModelList) {
tempAreaName.add(itemArea.name);
}
if (tempAreaName.length > tempTableName.length) {
for (var itemT in tempTableName) {
tempAreaName.removeWhere(
(element) => element == itemT); //全部区域移除有桌子的区域,剩下没有桌子的区域
}
for (var item in tempAreaName) {
for (AreaSunModel itemarea in areaSunModelList) {
if (item == itemarea.name) {
TableOuter tableOuter = TableOuter();
tableOuter.name = item;
tableOuter.list = [];
tableOuter.rid = itemarea.id;
tableOuterList.add(tableOuter); //区域信息包含有桌子和没有桌子两部分类型
}
}
}
}
}
... ... @@ -300,7 +312,7 @@ class TableManagerModel with ChangeNotifier {
}
//获取已预订列表
getReserveList(BuildContext context) async {
getReserveList(BuildContext context, {bool needLoading = true}) async {
tableMap.clear();
NoteBookModel model = new NoteBookModel();
Map<String, String> params = {
... ... @@ -312,8 +324,11 @@ class TableManagerModel with ChangeNotifier {
"keywords": "",
"sort": "1"
};
pageState = PageState.Loading;
notifyListeners();
if (needLoading) {
pageState = PageState.Loading;
notifyListeners();
}
List<Notebook> noteBooks = await newGetReserveList(context, params);
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
... ... @@ -422,6 +437,7 @@ class TableManagerModel with ChangeNotifier {
Area area = Area();
area.name = outer.name;
area.count = outer.list.length == 0 ? -1 : count;
area.rid = outer.list.length == 0 ? outer.rid : outer.list[0].rid;
areas.add(area);
}
if (areaTableMap.isNotEmpty) {
... ... @@ -525,10 +541,60 @@ class TableManagerModel with ChangeNotifier {
});
List<AreaSunModel> areaSunModelList;
if (baseResp.code == Constant.status_success) {
if (baseResp.data.length > 0) {
if (baseResp.data.length == 1 && baseResp.data[0] is String) {
return areaSunModelList;
} else if (baseResp.data.length > 0) {
areaSunModelList = AreaModel.fromJson(baseResp.responseData).data;
}
}
return areaSunModelList;
}
//添加商家桌位
Future<bool> addTable(
BuildContext context, Map<String, String> params) async {
params["sellerid"] = userModel.user.sellerid;
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.add_table,
data: params, showLoading: true)
.catchError((error) {
print(error.toString());
// if (error is MyError) {
// switch (error.type) {
// case 1:
// pageState = PageState.ConnectivityError;
// break;
// case 2:
// pageState = PageState.ConnectivityTimeOut;
// break;
// default:
// pageState = PageState.ConnectivityError;
// break;
// }
// }
// notifyListeners();
return false;
});
if (baseResp.code == Constant.status_success) {
if (baseResp.responseData['data'] != null &&
baseResp.responseData['data'].length > 0) {
return true;
} else {
Utils.showToast(baseResp.msg ?? '新增桌位失败!');
}
}
return false;
}
refreshTable(context) async {
List temp = await getTableList(context, needLoading: false);
if (temp.length > 0) {
getReserveList(context, needLoading: false);
} else {
// pageState = PageState.Empty;
pageState = PageState.Success;
notifyListeners();
}
}
}
... ...
... ... @@ -27,6 +27,7 @@ import 'package:one_key/models/table.dart' as t;
import 'package:url_launcher/url_launcher.dart';
typedef CustomCallBack = void Function(Object object);
typedef CustomCallBackMap = void Function(Map<String, String> object);
class DialogUtil {
static Future openCreateAreaDialog(BuildContext context,
... ... @@ -245,7 +246,7 @@ class DialogUtil {
static Future openCreateTableDialog(BuildContext context, List<String> areas,
int currentAreaIndex, List<String> pnum,
{CustomCallBack onTap}) async {
{CustomCallBackMap onTap}) async {
TextEditingController controller = TextEditingController();
FocusNode focusNode = FocusNode();
bool showArea = true;
... ... @@ -253,7 +254,7 @@ class DialogUtil {
bool showPnumMax = true;
String pnumMin = '';
String pnumMax = '';
StateSetter globalState;
// StateSetter globalState;
// //输入框焦点
// focusNode.addListener(() {
// if (!focusNode.hasFocus) {
... ... @@ -274,310 +275,314 @@ class DialogUtil {
barrierDismissible: false,
builder: (BuildContext context) {
return StatefulBuilder(builder: (context, state) {
globalState = state;
// globalState = state;
return Center(
child: Container(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(50)),
height: ScreenUtil().setWidth(326 * 2),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角
child: Stack(
overflow: Overflow.visible,
children: [
Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
child: Column(
children: [
Container(
// height: ScreenUtil().setWidth(48),
alignment: Alignment.center,
child: Text('新建桌位',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34),
color: MyColours.color_333333)),
),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(30 * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'*',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E95750),
),
Text(
'选择区域',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_333333),
),
HEmptyView(40),
// Stack(
// overflow: Overflow.visible,
// children: [
btnChoose(areas[currentAreaIndex],
ScreenUtil().setWidth(120 * 2), (value) {
state(() {
showPnumMin = true;
showPnumMax = true;
showArea = !showArea;
});
}),
],
),
),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(28 * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(50)),
height: ScreenUtil().setWidth(326 * 2) +
ScreenUtil().setWidth(45 * 2),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Stack(children: [
Column(
children: [
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil().setWidth(10)))), //设置圆角
child: Stack(
overflow: Overflow.visible,
children: [
Text(
'*',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E95750),
),
Text(
'桌位名称',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_333333),
),
HEmptyView(40),
Expanded(
child: TextField(
controller: controller,
maxLines: 1,
focusNode: focusNode,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_333333),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
bottom: ScreenUtil()
.setWidth(40)), //设置文字内容与边框距离
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_efefef),
Container(
padding: EdgeInsets.all(
ScreenUtil().setWidth(40)),
child: Column(
children: [
Container(
// height: ScreenUtil().setWidth(48),
alignment: Alignment.center,
child: Text('新建桌位',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(34),
color:
MyColours.color_333333)),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: MyColours.color_efefef,
width: ScreenUtil().setWidth(2)),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(30 * 2),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'*',
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_E95750),
),
Text(
'选择区域',
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_333333),
),
HEmptyView(40),
// Stack(
// overflow: Overflow.visible,
// children: [
btnChoose(
areas[currentAreaIndex],
ScreenUtil()
.setWidth(120 * 2),
(value) {
state(() {
showPnumMin = true;
showPnumMax = true;
showArea = !showArea;
});
}),
],
),
),
hintText: '请输入桌位名称',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(28 * 2),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'*',
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_E95750),
),
Text(
'桌位名称',
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_333333),
),
HEmptyView(40),
Expanded(
child: TextField(
controller: controller,
maxLines: 1,
focusNode: focusNode,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil()
.setSp(30),
color: MyColours
.color_333333),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
bottom: ScreenUtil()
.setWidth(
40)), //设置文字内容与边框距离
enabledBorder:
UnderlineInputBorder(
borderSide: BorderSide(
color: MyColours
.color_efefef),
),
focusedBorder:
UnderlineInputBorder(
borderSide: BorderSide(
color: MyColours
.color_efefef,
width: ScreenUtil()
.setWidth(2)),
),
hintText: '请输入桌位名称',
hintStyle: TextStyle(
color: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(30),
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType:
TextInputType.text,
),
)
],
),
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(30 * 2),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'人数(选填)',
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_333333),
),
HEmptyView(40),
// Stack(
// overflow: Overflow.visible,
// children: [
btnChoose(pnumMin,
ScreenUtil().setWidth(54 * 2),
(value) {
state(() {
showArea = true;
showPnumMax = true;
showPnumMin = !showPnumMin;
});
}),
HEmptyView(20),
Text(
'至',
style: TextStyle(
fontSize:
ScreenUtil().setSp(30),
color:
MyColours.color_199095),
),
HEmptyView(20),
btnChoose(pnumMax,
ScreenUtil().setWidth(54 * 2),
(value) {
state(() {
showArea = true;
showPnumMin = true;
showPnumMax = !showPnumMax;
});
}),
],
),
),
VEmptyView(80),
RoundButton(
text: '保存',
width: ScreenUtil().setWidth(300),
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
fontSize: 34,
onPressed: () {
if (controller.text.trim() ==
'') {
Utils.showToast('请输入桌位名称!');
return;
}
// 当前选中区域
// areas[currentAreaIndex]
//最低人数
// pnumMin
//最高人数
// pnumMax
onTap({
'areaname':
areas[currentAreaIndex],
'name': controller.text,
'pnumMin': pnumMin,
'pnumMax': pnumMax
});
Navigator.pop(context);
})
],
),
)
],
),
),
VEmptyView(60),
Container(
height: ScreenUtil().setWidth(30 * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'*',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E95750),
),
Text(
'人数(选填)',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_333333),
),
HEmptyView(40),
// Stack(
// overflow: Overflow.visible,
// children: [
btnChoose(
pnumMin, ScreenUtil().setWidth(52 * 2),
(value) {
state(() {
showArea = true;
showPnumMax = true;
showPnumMin = !showPnumMin;
});
}),
HEmptyView(20),
Text(
'至',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_199095),
),
HEmptyView(20),
btnChoose(
pnumMax, ScreenUtil().setWidth(52 * 2),
(value) {
state(() {
showArea = true;
showPnumMin = true;
showPnumMax = !showPnumMax;
});
}),
Positioned(
left: ScreenUtil().setWidth(113 * 2),
top: ScreenUtil().setWidth(105 * 2),
child: Offstage(
offstage: showArea,
child: selectWidget(areas, (index) {
state(() {
showArea = !showArea;
currentAreaIndex = index;
});
}),
)),
Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(30),
right: ScreenUtil().setWidth(40),
left: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(40),
),
child: Image.asset(
Utils.getImgPath('close'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28),
),
)),
)
],
),
),
VEmptyView(80),
RoundButton(
text: '保存',
width: ScreenUtil().setWidth(300),
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(10),
fontSize: 34,
onPressed: () {
if (controller.text.trim() == '') {
Utils.showToast('请输入桌位名称!');
return;
}
// 当前选中区域
// areas[currentAreaIndex]
//最低人数
// pnumMin
//最高人数
// pnumMax
onTap(controller.text);
Navigator.pop(context, controller.text);
})
],
),
)),
Container(
height: ScreenUtil().setWidth(45 * 2),
color: Colors.transparent)
],
),
Positioned(
left: ScreenUtil().setWidth(113 * 2),
top: ScreenUtil().setWidth(105 * 2),
child: Offstage(
offstage: showArea,
child: selectWidget(areas, (index) {
state(() {
showArea = !showArea;
currentAreaIndex = index;
});
}),
// child: Container(
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10)),
// border: Border.all(
// color: MyColours.color_cccccc,
// width: ScreenUtil().setWidth(2))),
// width: ScreenUtil().setWidth(120 * 2),
// height: ScreenUtil().setWidth(140 * 2),
// child: ListView.builder(
// padding: EdgeInsets.symmetric(
// horizontal:
// ScreenUtil().setWidth(20)),
// itemCount: areas.length,
// itemBuilder: (context, index) {
// return InkWell(
// onTap: () {
// state(() {
// showArea = !showArea;
// currentAreaIndex = index;
// });
// },
// child: Container(
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(20)),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: MyColours
// .color_efefef,
// width: ScreenUtil()
// .setWidth(2)))),
// child: Text(areas[index],
// style: TextStyle(
// color:
// MyColours.color_199095,
// fontSize: ScreenUtil()
// .setSp(28))),
// ),
// );
// }))
)),
Positioned(
left: ScreenUtil().setWidth(136 * 2),
top: ScreenUtil().setWidth(221 * 2),
child: Offstage(
offstage: showPnumMin,
child: selectWidget(pnum, (index) {
state(() {
showPnumMin = !showPnumMin;
pnumMin = pnum[index];
});
}),
)),
offstage: showPnumMin,
child: Material(
color: Colors.transparent,
child: selectWidget(pnum, (index) {
state(() {
showPnumMin = !showPnumMin;
pnumMin = pnum[index];
});
}),
))),
Positioned(
left: ScreenUtil().setWidth(223 * 2),
top: ScreenUtil().setWidth(221 * 2),
child: Offstage(
offstage: showPnumMax,
child: selectWidget(pnum, (index) {
state(() {
showPnumMax = !showPnumMax;
pnumMax = pnum[index];
});
}),
)),
Positioned(
top: 0,
right: 0,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(30),
right: ScreenUtil().setWidth(40),
left: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(40),
),
child: Image.asset(
Utils.getImgPath('close'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28),
),
)),
)
],
),
),
),
);
child: Material(
color: Colors.transparent,
child: Offstage(
offstage: showPnumMax,
child: selectWidget(pnum, (index) {
state(() {
showPnumMax = !showPnumMax;
pnumMax = pnum[index];
});
}),
))),
])));
});
});
}
... ...
... ... @@ -124,34 +124,38 @@ class NewTableItemState extends State<NewTableItem> {
// overflow: TextOverflow.ellipsis,
// ),
VEmptyView(6),
Text(
(table.reserver == null || table.reserver.isEmpty)
? '${table.tablePnum}人'
: table.reserver,
style: TextStyle(
color: (table.reserver == null ||
table.reserver.isEmpty)
? MyColours.color_353535
: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
table.tablePnum == null
? Container()
: Text(
(table.reserver == null || table.reserver.isEmpty)
? '${table.tablePnum}人'
: table.reserver,
style: TextStyle(
color: (table.reserver == null ||
table.reserver.isEmpty)
? MyColours.color_353535
: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(6),
Text(
table.lowStr,
style: TextStyle(
color: MyColours.color_777777,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
table.lowStr == ''
? Container()
: Text(
table.lowStr,
style: TextStyle(
color: MyColours.color_777777,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
],
),
),
widget.isRegionName
widget.isRegionName && table.regionName != null
? Positioned(
bottom: 0,
left: 0,
... ...