|
...
|
...
|
@@ -281,9 +281,183 @@ class DialogUtil { |
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
static Future openTableManageCreateAreaDialog(BuildContext context,
|
|
|
|
{CustomCallBack onTap}) async {
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
|
|
bool isRed = true;
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return StatefulBuilder(builder: (context, state) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
body: Center(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(50)),
|
|
|
|
height: ScreenUtil().setWidth(218 * 2 + 10),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(16))),
|
|
|
|
child: Card(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角
|
|
|
|
child: Container(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(64),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('添加区域',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_333333)),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(48 * 2),
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
isRed
|
|
|
|
? Text(
|
|
|
|
'*',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_E34D59),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
controller: controller,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
|
|
|
|
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)),
|
|
|
|
// ),
|
|
|
|
// prefixText: '*',
|
|
|
|
// prefixStyle: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// color: MyColours.color_E95750),
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '输入区域名称',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_BFC4D4,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
state(() {
|
|
|
|
if (controller.text == '') {
|
|
|
|
isRed = true;
|
|
|
|
} else {
|
|
|
|
isRed = false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(80),
|
|
|
|
MyDivider(double.infinity, ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '取消',
|
|
|
|
width: (ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil().setWidth(60) * 2) /
|
|
|
|
2,
|
|
|
|
height: ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_000000,
|
|
|
|
isBold: false,
|
|
|
|
fontSize: 34,
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}),
|
|
|
|
MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
RoundButton(
|
|
|
|
text: '确定',
|
|
|
|
width: (ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil().setWidth(60) * 2) /
|
|
|
|
2,
|
|
|
|
height: ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
textColor: isRed
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
fontSize: 34,
|
|
|
|
onPressed: () {
|
|
|
|
if (!isRed) {
|
|
|
|
if (controller.text.trim() == '') {
|
|
|
|
Utils.showToast('请输入区域名称!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
onTap(controller.text);
|
|
|
|
Navigator.pop(context, controller.text);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Future openCreateAreaDialog(BuildContext context,
|
|
|
|
{CustomCallBack onTap}) async {
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
|
|
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
...
|
...
|
@@ -423,6 +597,51 @@ class DialogUtil { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
static btnChooseTableManagePnum(
|
|
|
|
String title, String maxOrMin, double width, ClickCallback callback) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
callback(title);
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(20),
|
|
|
|
// vertical: ScreenUtil().setWidth(10)),
|
|
|
|
// height: ScreenUtil().setWidth(60),
|
|
|
|
// width: width,
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// border: Border(
|
|
|
|
// bottom: BorderSide(
|
|
|
|
// width: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7)),
|
|
|
|
// ),
|
|
|
|
// child:
|
|
|
|
Text(
|
|
|
|
title == ''
|
|
|
|
? maxOrMin == 'max'
|
|
|
|
? '最多'
|
|
|
|
: '最少'
|
|
|
|
: title,
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: title == ''
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setWidth(28)),
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
HEmptyView(14),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('table_manage_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(40),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
static btnChoose(String title, double width, ClickCallback callback) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
...
|
...
|
@@ -458,6 +677,42 @@ class DialogUtil { |
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static tableManageSelectWidget(
|
|
|
|
List<String> data, double height, CustomCallBack onTap) {
|
|
|
|
return 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(height),
|
|
|
|
child: ListView.builder(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
|
|
|
|
itemCount: data.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap(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(data[index],
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
static selectWidget(List<String> data, CustomCallBack onTap) {
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
...
|
...
|
@@ -495,6 +750,555 @@ class DialogUtil { |
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Future openMyTableManageCreateTableDialog(
|
|
|
|
BuildContext context, List<String> baojianList, List<String> pnum,
|
|
|
|
{CustomCallBackMap onTap}) async {
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController _norNumController = TextEditingController();
|
|
|
|
FocusNode _norNumFocusNode = FocusNode();
|
|
|
|
bool showBaojian = true;
|
|
|
|
bool showPnumMin = true;
|
|
|
|
bool showPnumMax = true;
|
|
|
|
String pnumMin = '';
|
|
|
|
String pnumMax = '';
|
|
|
|
int currentBaojianIndex = 0;
|
|
|
|
String baojian = baojianList[currentBaojianIndex];
|
|
|
|
bool mulCreate = false;
|
|
|
|
// StateSetter globalState;
|
|
|
|
// //输入框焦点
|
|
|
|
// focusNode.addListener(() {
|
|
|
|
// if (!focusNode.hasFocus) {
|
|
|
|
// // print('失去焦点');
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
// // print('得到焦点');
|
|
|
|
// globalState(() {
|
|
|
|
// showPnumMin = true;
|
|
|
|
// showPnumMax = true;
|
|
|
|
// showArea = true;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Center(child: StatefulBuilder(builder: (context, state) {
|
|
|
|
// globalState = state;
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(300)),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(50)),
|
|
|
|
// height: ScreenUtil().setWidth(326 * 2) +
|
|
|
|
// ScreenUtil().setWidth(250 * 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: [
|
|
|
|
Container(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(64),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(44)),
|
|
|
|
// height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('新建桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_333333)),
|
|
|
|
),
|
|
|
|
VEmptyView(60),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
state(() {
|
|
|
|
mulCreate = !mulCreate;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(44)),
|
|
|
|
height: ScreenUtil().setWidth(30 * 2),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
HEmptyView(32),
|
|
|
|
Text('批量创建',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_000000)),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
mulCreate
|
|
|
|
? Utils.getImgPath(
|
|
|
|
'table_manage_swich_on')
|
|
|
|
: Utils.getImgPath(
|
|
|
|
'table_manage_swich_off'),
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(60),
|
|
|
|
// height: ScreenUtil().setWidth(82),
|
|
|
|
),
|
|
|
|
HEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
VEmptyView(30),
|
|
|
|
// MyDivider(double.infinity,
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7),
|
|
|
|
// VEmptyView(30),
|
|
|
|
mulCreate
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(72),
|
|
|
|
),
|
|
|
|
child: textfield(
|
|
|
|
context,
|
|
|
|
'数量',
|
|
|
|
'填写个数',
|
|
|
|
_norNumController,
|
|
|
|
_norNumFocusNode,
|
|
|
|
'人'))
|
|
|
|
: Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(44)),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(48 * 2),
|
|
|
|
// margin: EdgeInsets.symmetric(
|
|
|
|
// horizontal:
|
|
|
|
// ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(10))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
controller: controller,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_515151),
|
|
|
|
|
|
|
|
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)),
|
|
|
|
// ),
|
|
|
|
// prefixText: '*',
|
|
|
|
// prefixStyle: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// color: MyColours.color_E95750),
|
|
|
|
border:
|
|
|
|
OutlineInputBorder(
|
|
|
|
borderSide:
|
|
|
|
BorderSide
|
|
|
|
.none),
|
|
|
|
hintText: '桌位名称',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType:
|
|
|
|
TextInputType.text,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
state(() {
|
|
|
|
showPnumMax = true;
|
|
|
|
showPnumMin = true;
|
|
|
|
showBaojian = !showBaojian;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(44)),
|
|
|
|
height: ScreenUtil().setWidth(30 * 2),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
HEmptyView(32),
|
|
|
|
Text(
|
|
|
|
'桌位类型',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32),
|
|
|
|
color:
|
|
|
|
MyColours.color_000000),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
// Stack(
|
|
|
|
// overflow: Overflow.visible,
|
|
|
|
// children: [
|
|
|
|
Text(
|
|
|
|
baojian,
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_515151,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
HEmptyView(12),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'table_manage_arrow_down'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(40)),
|
|
|
|
HEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
|
|
|
|
mulCreate
|
|
|
|
? SizedBox()
|
|
|
|
: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(60)),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(44),
|
|
|
|
right:
|
|
|
|
ScreenUtil().setWidth(44)),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(30 * 2),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
HEmptyView(32),
|
|
|
|
Text(
|
|
|
|
'人数',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_000000),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
// Stack(
|
|
|
|
// overflow: Overflow.visible,
|
|
|
|
// children: [
|
|
|
|
btnChooseTableManagePnum(
|
|
|
|
pnumMin,
|
|
|
|
'min',
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(54 * 2),
|
|
|
|
(value) {
|
|
|
|
state(() {
|
|
|
|
showBaojian = true;
|
|
|
|
showPnumMax = true;
|
|
|
|
showPnumMin = !showPnumMin;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
HEmptyView(40),
|
|
|
|
Text(
|
|
|
|
'至',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_000000),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
btnChooseTableManagePnum(
|
|
|
|
pnumMax,
|
|
|
|
'max',
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(54 * 2),
|
|
|
|
(value) {
|
|
|
|
state(() {
|
|
|
|
showBaojian = true;
|
|
|
|
showPnumMin = true;
|
|
|
|
showPnumMax = !showPnumMax;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
HEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(80),
|
|
|
|
MyDivider(double.infinity,
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '取消',
|
|
|
|
width: (ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(110) *
|
|
|
|
2) /
|
|
|
|
2,
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
gradientEnd:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_000000,
|
|
|
|
isBold: false,
|
|
|
|
fontSize: 34,
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}),
|
|
|
|
MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
RoundButton(
|
|
|
|
text: '确定',
|
|
|
|
width: (ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(110) *
|
|
|
|
2) /
|
|
|
|
2,
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
gradientEnd:
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
textColor: controller.text == ''
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_438E93,
|
|
|
|
fontSize: 34,
|
|
|
|
onPressed: () {
|
|
|
|
if (controller.text.trim() ==
|
|
|
|
'') {
|
|
|
|
Utils.showToast('请输入桌位名称!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// 当前选中区域
|
|
|
|
// areas[currentAreaIndex]
|
|
|
|
//最低人数
|
|
|
|
// pnumMin
|
|
|
|
//最高人数
|
|
|
|
// pnumMax
|
|
|
|
|
|
|
|
onTap({
|
|
|
|
'areaname': baojianList[
|
|
|
|
currentBaojianIndex],
|
|
|
|
'name': controller.text,
|
|
|
|
'pnumMin': pnumMin,
|
|
|
|
'pnumMax': pnumMax
|
|
|
|
});
|
|
|
|
Navigator.pop(context);
|
|
|
|
}),
|
|
|
|
])
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
left: ScreenUtil().setWidth(100 * 2),
|
|
|
|
top: ScreenUtil().setWidth(105 * 2),
|
|
|
|
child: Offstage(
|
|
|
|
offstage: showBaojian,
|
|
|
|
child: tableManageSelectWidget(
|
|
|
|
baojianList, 210, (index) {
|
|
|
|
state(() {
|
|
|
|
showBaojian = !showBaojian;
|
|
|
|
currentBaojianIndex = index;
|
|
|
|
baojian =
|
|
|
|
baojianList[currentBaojianIndex];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
left: ScreenUtil().setWidth(30 * 2),
|
|
|
|
top: ScreenUtil().setWidth(112 * 2),
|
|
|
|
child: Offstage(
|
|
|
|
offstage: showPnumMin,
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: selectWidget(pnum, (index) {
|
|
|
|
state(() {
|
|
|
|
showPnumMin = !showPnumMin;
|
|
|
|
pnumMin = pnum[index];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
))),
|
|
|
|
Positioned(
|
|
|
|
left: ScreenUtil().setWidth(106 * 2),
|
|
|
|
top: ScreenUtil().setWidth(132 * 2),
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Offstage(
|
|
|
|
offstage: showPnumMax,
|
|
|
|
child: selectWidget(pnum, (index) {
|
|
|
|
state(() {
|
|
|
|
showPnumMax = !showPnumMax;
|
|
|
|
pnumMax = pnum[index];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
))),
|
|
|
|
]));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///输入框
|
|
|
|
static Widget textfield(
|
|
|
|
BuildContext context,
|
|
|
|
String title,
|
|
|
|
String hintText,
|
|
|
|
TextEditingController editingController,
|
|
|
|
FocusNode focusNode,
|
|
|
|
String subTitle,
|
|
|
|
{bool needStar = false,
|
|
|
|
TextInputType inputType = TextInputType.number}) {
|
|
|
|
return Container(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
needStar
|
|
|
|
? Container(
|
|
|
|
child: Text(
|
|
|
|
'*',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
// Spacer(),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
// height: ScreenUtil().setHeight(120),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(20),
|
|
|
|
right: ScreenUtil().setWidth(10),
|
|
|
|
top: ScreenUtil().setWidth(8)),
|
|
|
|
child: TextField(
|
|
|
|
controller: editingController,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
inputFormatters: [],
|
|
|
|
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
focusNode: focusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_BFC4D4,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: inputType,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
subTitle,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Future openCreateTableDialog(BuildContext context, List<String> areas,
|
|
|
|
int currentAreaIndex, List<String> pnum,
|
|
|
|
{CustomCallBackMap onTap}) async {
|
|
...
|
...
|
@@ -919,7 +1723,7 @@ class DialogUtil { |
|
|
|
child: Text(
|
|
|
|
"取消",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_5688F3,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
...
|
...
|
|